-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Revert #83357 and achieve the same impact on serde-json by adding a check in Vec::spec_extend #83797
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
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
r? @dtolnay |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 0dc772e with merge 7e666f9e8f9482542bd6b4dd7e39126881298982... |
☀️ Try build successful - checks-actions |
Queued 7e666f9e8f9482542bd6b4dd7e39126881298982 with parent 9b6c9b6, future comparison URL. |
Finished benchmarking try commit (7e666f9e8f9482542bd6b4dd7e39126881298982): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
I do not know why this is slower. I'm going to stand up the rustc-perf benchmarking locally and try to figure this out. |
This reverts commit 0dc772e.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 85bd865 with merge 13e6b40edb3de60b505f197a5a470cdd98f8fa74... |
☀️ Try build successful - checks-actions |
Queued 13e6b40edb3de60b505f197a5a470cdd98f8fa74 with parent 0850c37, future comparison URL. |
Finished benchmarking try commit (13e6b40edb3de60b505f197a5a470cdd98f8fa74): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
I'm just more confused now. There's evidence posted in #83357 that the inlining tweaks were a regression, but now undoing them is also a regression?? |
Oh, the link in #83357 (comment) points to the max-rss report, not instructions (the default). max-rss tends to be noisy, but the reverts seem to be biased towards an improvement, i.e. it recovers the max-rss regression but also undoes the compile time improvements. |
Wow I was really looking in the wrong direction. I have no idea why max-rss would be impacted by these changes. My instinct is that blaming a max-rss regression on #83357 is a mistake; it doesn't change when and with what arguments any allocator is invoked. If it changes the size of anything, it should reduce code size. |
The PR was not part of a rollup, so the perf runs are a direct comparison with its parent commit. And we have three comparisons now and all point in the same direction so that makes it less likely to be noise.
So, reverting fixes the memory footprint issue. But it also undoes the instruction count improvements on some of the parts that involve little to no heavy lifting on the LLVM side (e.g. So perhaps run one of the non-opt benchmarks under One possibility might be that you focused only on |
@saethlin do the serde speedups mostly come from |
@the8472 The |
rust/library/std/src/io/impls.rs Lines 384 to 387 in c051c5d
calls rust/library/alloc/src/vec/mod.rs Lines 2118 to 2120 in c051c5d
which should specialize to rust/library/alloc/src/vec/spec_extend.rs Lines 83 to 86 in c051c5d
calls rust/library/alloc/src/vec/mod.rs Lines 1693 to 1700 in c051c5d
So there's a reserve, but it's not the one in spec_extend that's relevant if you want to optimize serde. I think that warrents a few separate PRs. One for serde improvements. One purely for the revert, assuming the libs team prefers to keep |
FWIW, I made a bunch of improvements to these code paths last year to reduce code size. At first the changes gave obvious improvements, but by the end things were getting unpredictable and it was hard to improve some things without regressing other things. |
I was never sure what the next steps were on here, and the codebase seems to have moved on a bit. I'm still here, but this PR isn't really. |
No description provided.