-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
RangeInclusive
performance regression in beta + nightly
#119643
Comments
Ok, this seems to be a missed-opt compiler regression. replacing b.iter(|| {
let lerp = Linear {
interpolate: LinearInterpolation {
start: 1.0,
step: 1.0,
},
length: 200,
};
let grid = GridSpaceInterpolation([lerp, lerp]);
let space = Space {
interpolate: grid,
range: 1..=40000,
};
bench(space);
}) with b.iter(f)
fn f() {
let lerp = Linear {
interpolate: LinearInterpolation {
start: 1.0,
step: 1.0,
},
length: 200,
};
let grid = GridSpaceInterpolation([lerp, lerp]);
let space = Space {
interpolate: grid,
range: 1..=40000,
};
bench(space);
} removed the perf regression. perhaps it's a missed const-prop. I can't tell any noticeable difference in the generated assembly though |
Thanks, I'll test with that branch |
It does indeed look like #111344 does resolve this regression
|
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Fixed on latest nightly, thanks |
It's fixed only on nightly though, does anyone know what is the policy for backporting performance fixes? |
I've added beta-nominated in the hopes of finding out if backporting this perf fix to beta is acceptable. |
@ChrisDenton this is an issue. I see a number of PRs about solving this issue. I think #119670 is the object of your backport request, am I right? Can you help me out? 🙂 Thanks! |
Oh no, sorry! I totally spaced on that. I'll add to the PR> |
Code
I tried this code:
https://github.com/conradludgate/iter-num-tools/blob/024f521782cd241dea81d031cf802f22fc66bab9/benches/gridspace.rs
I expected to see this happen: Benchmark results to stay consistent between versions
Instead, this happened:
Version it worked on
It most recently worked on:
Version with regression
rustc +beta --version --verbose
:rustc +nightly --version --verbose
:More info
I haven't been able to fully track down the regression, but it has something to do with RangeInclusive. Changing the benchmark to
grid_space([1.0, 1.0]..[100.0, 100.0], 200)
shows much less difference between versions. So far, the smallest I have reduced the repro is https://gist.github.com/conradludgate/b604d1ab0898df3babd80e384377c2b2The text was updated successfully, but these errors were encountered: