Skip to content

Replace Vec with EcoVec, removed Box - #2420

Merged
laurmaedje merged 1 commit into
typst:mainfrom
Dherse:error-optimizations
Oct 17, 2023
Merged

laurmaedje merged 1 commit into
typst:mainfrom
Dherse:error-optimizations

Conversation

@Dherse

@Dherse Dherse commented Oct 17, 2023

Copy link
Copy Markdown
Contributor

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
@laurmaedje

Copy link
Copy Markdown
Member

Thanks!

@Dherse
Dherse deleted the error-optimizations branch November 2, 2023 12:22
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
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