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

Move capacity overflow panic to own cold function #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GnomedDev
Copy link

This removes a couple instructions from ThinVec::push and probably other methods as previously each expect was getting it's own jump to call expect_failed whereas with this they can all simply jump to call capacity_overflow. This also leads to the inlining of header_with_capacity into ThinVec::push, which was previously an outlined call.

I can't find any benchmarks in the repo to test against, but the increased inlining with a smaller method sounds like a good thing.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 30, 2024
[DO NOT MERGE] Perf run for ThinVec capacity overflow outlining

Testing out the performance difference of Gankra/thin-vec#63

r​? `@ghost`
src/lib.rs Outdated Show resolved Hide resolved
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