-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Reduce the DepNode
pre-allocation ratio.
#59626
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
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
☀️ Try build successful - checks-travis |
@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.
6c9867d
to
304a7be
Compare
@Zoxc: I added the +200 you requested. |
@bors rollup |
@bors r+ |
📌 Commit 304a7be has been approved by |
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
☀️ Test successful - checks-travis, status-appveyor |
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