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

Some performance tweaks #27

Merged
merged 13 commits into from
Jul 12, 2024
Merged

Some performance tweaks #27

merged 13 commits into from
Jul 12, 2024

Conversation

allenap
Copy link
Owner

@allenap allenap commented Jul 12, 2024

Some experiments to try and improve performance, including adding a new UTF-8 benchmark for all quoters. Two big lessons:

  • Pre-calculating the required output buffer capacity seems to be slightly slower than letting Vec do its thing. In the end, I went with simpler-is-better and removed the pre-calculation code. If memory usage becomes a priority then it might be worth revisiting this.
  • Trying to outdo Vec is hard. I created a custom Chain data type to avoid reallocations – which I didn't optimise much, to be fair – but it was 2+ times slower that letting Vec follow its own reallocation strategy.

@allenap allenap merged commit 29e8d34 into master Jul 12, 2024
3 checks passed
@allenap allenap deleted the performance branch July 12, 2024 11:00
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.

1 participant