Uh oh!
There was an error while loading. Please reload this page.
perf: UninhabitedEnumBranching avoid n^2 - #77597
Conversation
rust-highfive
commented
Oct 5, 2020
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
estebank
commented
Oct 5, 2020
@bors try @rust-timer queue |
rust-timer
commented
Oct 5, 2020
Awaiting bors try build completion |
bors
commented
Oct 5, 2020
⌛ Trying commit de89fb67fb8292b1f27f59ea7d585a3e95c9d520 with merge c7115a3597a7b1fbced7d79b8a23e22359edc73d... |
There was a problem hiding this comment.
| FxHashSet::from_iter(variant_discriminants(&layout, discriminant_ty, tcx)) | |
| variant_discriminants(&layout, discriminant_ty, tcx).collect() |
..then you can remove the FromIterator import
There was a problem hiding this comment.
variant_discriminants could be changed to return a FxHashSet directly which would avoid some overhead.
There was a problem hiding this comment.
Addressed in latest commit
bors
commented
Oct 5, 2020
☀️ Try build successful - checks-actions, checks-azure |
rust-timer
commented
Oct 5, 2020
Queued c7115a3597a7b1fbced7d79b8a23e22359edc73d with parent a1dfd24, future comparison URL. |
rust-timer
commented
Oct 6, 2020
Finished benchmarking try commit (c7115a3597a7b1fbced7d79b8a23e22359edc73d): 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 interpret the perf results as being good. This PR should not change behavior, so in a perfect deterministic world I would only expect optimized_mir to be affected by this change. I therefore see all regressions reported in LLVM as noise. For match-stress-enum this is a clear win. All other benchmarks look neutral. |
jonas-schievink
commented
Oct 6, 2020
r=me with #77597 (comment) addressed |
Avoid n² complexity. This showed up in a profile for match-stress-enum that has 8192 variants
de89fb6 to
e231c47Comparejonas-schievink
commented
Oct 7, 2020
@bors r+ |
bors
commented
Oct 7, 2020
📌 Commit e231c47 has been approved by |
bors
commented
Oct 7, 2020
bors
commented
Oct 8, 2020
☀️ Test successful - checks-actions, checks-azure |
Mark-Simulacrum
commented
Oct 13, 2020
As expected, a minor improvement on the match stress test (https://perf.rust-lang.org/compare.html?start=91a79fb29ac78d057d04dbe86be13d5dcc64309a&end=e055f87cdfcac1f4da6c518a547dee459de0aa26&stat=instructions:u). Slight (0.1%) wins on other benchmarks. Great work! |
Avoid n² complexity. This showed up in a profile for match-stress-enum that has 8192 variants
I have only profiled locally against
match-stress-enum, so we should have it perf tested to make sure it does not regress other crates.