-
Notifications
You must be signed in to change notification settings - Fork 32
Description
In pdfTeX, long documents with many short markdown fragments present a speed challenge, since every fragment loads the whole Markdown package with its requirements and PEG parsers. The cache implemented by the option eagerCache
improves the situation by preventing the repeated parsing of the same fragments on subsequent runs. However, the package is still loaded.
We should separate the file markdown.lua
into a new file markdown-parser.lua
, which would contain most of the current implementation, and a smaller file markdown.lua
, which would only contain a skeleton method M.new()
. This method would lazily load the Markdown package only when there is a conversion attempt that cannot be satisfied by the cache.
Adding an extra file would make the manual installation somewhat more error-prone and would slightly increase the chance of version mismatch between files. However, it would provide us with some extra breathing room when it comes to speed.