-
Notifications
You must be signed in to change notification settings - Fork 13k
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
30% regression in compile time of tuple-stress benchmark #43828
Comments
The "after" column is faster than "before", did you swap them by accident? |
It's probably because the test case is almost entirely composed of float literals, and as of #43554 those literals are parsed twice (once with |
@jonas-schievink oops yes |
Only constant checking and MIR building should do the parsing though. Expansion, for example, couldn't possibly be affected - I suspect there's more than one factor hiding in here. |
Another thing is that "const checking" is quadratic in the number of expression nodes (which are considered to be constant) that are part of the same subtree, as const-evaluation isn't cached (yet). |
triage: P-high Assigning to @eddyb to decide if there is something to be concerned about here or not. =) |
On the graph "expansion" has a small random jump from The culprits (adding up to most of the total change):
Sadly, my idea for caching const-evaluation wouldn't do much for MIR building, have to look further. |
Speed up APFloat division by using short division for small divisors. Fixes #43828 (hopefully), by not doing long division bit-by-bit for small divisors. When parsing the ~200,000 decimal float literals in the `tuple-stress` benchmark, this change brings roughly a 5x speed increase (from `0.6s` to `0.12s`), and the hottest instructions are native `div`s.
The graph looks pretty good - still about half a second more, but the regression is much less worse. |
Oh no I was personally satisfied with any outcome, I just figured it'd be good to track regressions as they came up! Thanks for the fix @eddyb! |
IMO, if reopening the issue makes @eddyb perform another "5x speed increase" then we should trick them into doing such 😇 |
According to perf.rust-lang.org graphs the tuple-stress benchmark has regressed 30% in compile time lately, pointing to #43554 as the culprit.
I've downloaded the
nightly-2017-08-05
toolchain and thenightly-2017-08-06
toolchain where 08-06 has this PR and 08-05 doesn't. The notable differences in time-passes are:cc @eddyb
The text was updated successfully, but these errors were encountered: