Skip to content

Outline reserve slow paths#5

Open
charliermarsh wants to merge 1 commit into
ryota2357:mainfrom
astral-sh:charlie/outline-reserve-slow-paths
Open

Outline reserve slow paths#5
charliermarsh wants to merge 1 commit into
ryota2357:mainfrom
astral-sh:charlie/outline-reserve-slow-paths

Conversation

@charliermarsh

Copy link
Copy Markdown
Contributor

reserve currently carries allocation and copy-on-write logic even when a string already has enough capacity. This moves those uncommon cases into separate functions, making common append and reserve operations faster without changing behavior.

Local Apple arm64 benchmarks showed improvements of 7–29% across the measured append paths, with about a 0.2% increase in code size. The benchmark suite is maintained separately and is not included in this PR.

@ryota2357

ryota2357 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Thank you for the PR and the benchmark results. They look very promising.

This might be a bit of a personal preference, but I'd like to check the cargo asm output before merging. I'll get this merged in a few days.

@charliermarsh

Copy link
Copy Markdown
Contributor Author

Take your time or even feel free to reject it if you prefer, no pressure.

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