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

Optimise parsing by removing excessive copying. #278

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

maciejtrybilo
Copy link
Contributor

In the current implementation the copy-on-write causes excessive copying when building the box tree.

I've inlined the merge function into transformToBoxTree and used a storage variable to avoid it being passed around and copied.

In my tests this results in a ~30x speedup and makes all the difference in my use case.

Also IMO the code is a little clearer now as it shows the recursive nature of the algorithm in one function.

@Joannis Joannis merged commit ced9c53 into CoreOffice:main Feb 12, 2024
6 of 15 checks passed
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.

2 participants