-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use Rc instead of Box for interned strings. #50549
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
@Zoxc, do you see a problem with using |
This use of |
OTOH, there wouldn't be a real downside to using |
It would be slower. |
Yes, but I wouldn't expect the difference to be noticeable. |
We currently heap-allocate each one twice, once for Interner::names and once for Interner::strings. Using Rc instead means each one is allocated once and then shared. This speeds up numerous rustc-perf runs, the best by 4%.
Updated with the r? @Zoxc |
Allocate Symbol strings from an arena This is an alternative to #50549 cc @nnethercote r? @michaelwoerister
#50607 is a much better way of doing things. |
Allocate Symbol strings from an arena This is an alternative to rust-lang#50549 cc @nnethercote r? @michaelwoerister
We currently heap-allocate each one twice, once for Interner::names and
once for Interner::strings. Using Rc instead means each one is allocated
once and then shared.
This speeds up numerous rustc-perf runs, the best by 4%.
Here are details for the ones with an improvement of 1% or more: