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.
Reduce the `DepNode` pre-allocation ratio. #59626
Conversation
|
I'll do a perf run, but @bors try |
Reduce the `DepNode` pre-allocation ratio. A code size of increase of 15% is overly generous. 2% is more realistic. This change reduces peak memory size by 20+ MiB on some workloads. r? @Zoxc
|
|
|
@rust-timer build 15dbaaa |
|
Success: Queued 15dbaaa with parent f694222, comparison URL. |
|
Finished benchmarking try commit 15dbaaa |
|
The |
|
@nnethercote How did you arrive at the 2% is realistic conclusion? |
|
I looked at all the incremental "patched" cases in rustc-perf and they almost all fit within 0.5%, with many being quite a bit less. (There was one 20% case.) So I rounded up a bit to be safe. More generally, 15% seems really generous -- for the crate to increase in size that much would be very rare unless it's a very small crate. |
|
@Zoxc: Anything else I can do to convince you that this is a reasonable change? :) |
|
I don't think the incremental "patched" cases in rustc-perf are very representative though. A low percentage doesn't seem great for small crates either. Maybe something like |
|
I think trying to catch the 20% case is a bad idea. It was a single exceptional case out of dozens; this should be tuned to work well with common cases. And small crates are less important, because they're already fast to compile. If the size is too small we'll just have to reallocate the table once, it's not that big a deal... |
|
FWIW, here are the sizes and ratios seen in
|
|
If we had a +200 constant we could catch the |
A code size of increase of 15% is overly generous. 2% is more realistic. This change reduces peak memory size by 20+ MiB on some workloads.
|
@Zoxc: I added the +200 you requested. |
|
@bors rollup |
|
@bors r+ |
|
|
Reduce the `DepNode` pre-allocation ratio. A code size of increase of 15% is overly generous. 2% is more realistic. This change reduces peak memory size by 20+ MiB on some workloads. r? @Zoxc
|
|
A code size of increase of 15% is overly generous. 2% is more realistic.
This change reduces peak memory size by 20+ MiB on some workloads.
r? @Zoxc