-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Replace String
with CompactString
#620
Conversation
Very nice! I can confirm these results with a full-numbat-startup benchmark.
One thing I would like to understand is the following: do we need to go "all in" on this? Or is there maybe one module/component which accounts for >90% of the speedup? The code changes are not too bad, but it's still minor a complication. Especially for contributors who are new to the code base. |
Right, it probably makes almost no different for e.g., |
That said, I think the complexity is fairly low. |
Thank you! |
Numbat stores lots and lots of strings. Most of these are pretty short: unit names, variable names, function names... names generally shorter than the 24-byte cutoff at which
compact_str::CompactString
moves its data from the stack to the heap. This means we can often get away with zero heap allocations for the strings Numbat stores.This results in a massive improvement over
master
(far larger than my previous owned-string-to-borrowed-string changes).