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

Reduce parsing allocations #18

Merged
merged 6 commits into from
Nov 30, 2024
Merged

Reduce parsing allocations #18

merged 6 commits into from
Nov 30, 2024

Conversation

TimJentzsch
Copy link
Owner

@TimJentzsch TimJentzsch commented Nov 25, 2024

Closes #14 (for now, there are probably still a lot of things we can improve).

Adds a lifetime to the parsed BBCode and uses references or Cow where possible to reduce the amount of needed allocations.

I'm benchmarking on a laptop, which is quite unreliable. But I measured a performance improvement of about 10%. Less than I hoped for, but still decent.

@TimJentzsch TimJentzsch marked this pull request as ready for review November 30, 2024 13:13
@TimJentzsch TimJentzsch merged commit 4ec78de into main Nov 30, 2024
4 checks passed
@TimJentzsch TimJentzsch deleted the 14-zero-alloc-parsing branch November 30, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero-alloc parsing
1 participant