Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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: