-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the speed of the Markdown package #474
Comments
In version 3.4.3, we upgraded to TeX Live 2024, which may be related to the slow-down. I will now run the same experiment using TeX Live 2022 for all versions of the Markdown package to control for this effect. With TeX Live, the potential sources of the slow-down would be the KPathSea library, which we use to locate external resources, and other Lua libraries that we use, which may have become slower in TeX Live 2024. In commit efeaecb, I repeated the experiment using TeX Live 2022 for all versions of the Markdown package to control for this effect. The results show that the version of TeX Live is not a major factor (for |
As discussed in #458 (comment), the issue is likely (also) with PRs #416 and #432, which started loading If this is the case, which is still to be determined, then pre-reading the file However, we may still wish to check if there is a more up-to-date version of |
I continued the experiment to determine which of the eight PRs merged in version 3.4.3 caused the slow-down: As assumed in #474 (comment), the more than 5× slow-down is caused by PRs #416, which started loading The solution is to use a prefix tree to optimize the parser, as described in #474 (comment). Precompiling the parser may bring a further improvement and help us close ticket #458 but will likely produce less improvement. |
In PR #482, the speed of the Markdown package has been significantly improved: The speed improvement was achieved by using a prefix tree to construct a more efficient PEG parser of Unicode punctuation. Many thanks to the contributor @Yggdrasil128 for their help with the fix! |
@Yggdrasil128: If you'd like, we have a Discord server and a space at Matrix.org. It can be faster to discuss the development of the Markdown package compare to GitHub. |
The current version of the Markdown package for TeX takes multiple seconds to initialize and process a markdown text:
In a recent experiment, I processed a short text with historic versions of the Markdown package and I compared them with the current version of the Markdown package. The results show a more than 5× slow-down in version 3.4.3 of the Markdown package:
A PR that closes this ticket should take the following steps:
The text was updated successfully, but these errors were encountered: