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

Replace Vec with EcoVec, removed Box #2420

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

Dherse
Copy link
Sponsor Collaborator

@Dherse Dherse commented Oct 17, 2023

See #2393.

As it turns out, errors are not so cheap to clone and not so rare: delayed errors can create large amounts of SourceDiagnostics that are cloned in function calls and processed as delayed errors, this means that the extra level of indirection (the Box<..> that used to be surrounding errors in SourceResult<T>) and the expensive cloning (memcpy over the entire contents) were expensive on documents that make use of delayed errors a lot (citations/refs inside of locate).

@laurmaedje laurmaedje merged commit 37a988a into typst:main Oct 17, 2023
3 checks passed
@laurmaedje
Copy link
Member

Thanks!

@Dherse Dherse deleted the error-optimizations branch November 2, 2023 12:22
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