On Thursday, May 31, 2018 at 12:22:00 PM UTC-5, Edward K. Ream wrote:
>
>
> On Thursday, May 31, 2018 at 5:02:47 AM UTC-5, Edward K. Ream wrote:
>
> load_derived_file is incredibly fast.
>>
>
> The main loop, << iterate all other lines >> might be made significantly
> faster by short-circuiting most tests at the start of the loop.
>
Wow. The following short-circuit test suffices to drop the typical load
time from 6-7 seconds to 4.5 seconds.
if not (
verbatim or line == verbline or
in_doc or line.strip().startswith(delim_st)
):
# unindent the line if necessary
if indent and line[:indent].isspace() and len(line) > indent:
line = line[indent:]
body.append(line)
continue
What is this, something like a 20% speedup??
No summary regex's are required! In fact, using them slows down the
short-circuit test!
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.