Skip to content
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

Optimized labels & introspector #2801

Merged
merged 5 commits into from
Nov 30, 2023
Merged

Optimized labels & introspector #2801

merged 5 commits into from
Nov 30, 2023

Conversation

Dherse
Copy link
Sponsor Collaborator

@Dherse Dherse commented Nov 29, 2023

As the title says, this is (yet another) round of optimizations this time focused on queries. It allows labels to be cached in the Introspector and used more efficiently for queries and query_label. Overall this gives us a small but measurable performance gain of 15-30% depending on the scenario. Cold gains (as always) are a little lower but it brings us down to (almost) the ~5s compile times.

This also improves the allocation pattern of Introspector to allow it to pre-allocate larger structures from the previous Introspector's sizes. Also moves Introspector into Document allowing the PDF export code to re-use the existing introspector instead of creating its own. These two changes might seem esoteric and undeeded, but their impact is measurable at around a ~50ms reduction in compile time across both incremental and cold.

@laurmaedje laurmaedje merged commit 5bdec9e into typst:main Nov 30, 2023
6 checks passed
@laurmaedje
Copy link
Member

Thank you!

@Dherse Dherse deleted the label-opt branch December 13, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants