-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#37660 appears to have regressed performance by ~6% on bootstrap, due to a near tripling in time for item-bodies checking (23s to 62s). I'm not sure if that was expected or not, but someone should probably investigate. Let me know if I should open a new issue about that.
See here for a comparison across all crates.
Metadata
Metadata
Assignees
Labels
I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Mark-Simulacrum commentedon Nov 18, 2016
Better comparison here (more localized to the exact time range): http://perf.rust-lang.org/compare.html?date_a=2016-11-17T05%3A13%3A09.000Z&date_b=2016-11-18T01%3A31%3A01.000Z&kind=benchmarks&crates=futures-rs-test-all%2Chelloworld%2Chtml5ever-2016-08-25%2Chyper.0.5.0%2Cinflate-0.1.0%2Cissue-32062-equality-relations-complexity%2Cissue-32278-big-array-of-strings%2Cjld-day15-parser%2Cpiston-image-0.10.3%2Cpiston-image-0.3.11%2Cregex-macros.0.1.30%2Cregex.0.1.30%2Crust-encoding-0.3.0%2Crust-encoding.0.2.32%2Csyntex-0.42.2%2Csyntex-0.42.2-incr-clean&phases=total&group_by=crate.
nikomatsakis commentedon Nov 18, 2016
Hmm, yeah, not really expected.
nikomatsakis commentedon Nov 18, 2016
This is the diff that affected
rustc_typeck
crate:https://gist.github.com/nikomatsakis/ca47ebbcd264452539074899b6d09355
Not seeing yet what might have caused such a perturbation.
michaelwoerister commentedon Nov 18, 2016
@eddyb: You also had a look at that PR, any ideas?
Mark-Simulacrum commentedon Nov 18, 2016
Is it possible the PR increased the amount of code in librustc and hit a pathological case in some way? This shows that most crates had little-to-no difference except for librustc itself, which jumped up by ~30 seconds.
michaelwoerister commentedon Nov 18, 2016
The syntex-syntax test case also shows the regression, so there's definitely something to it.
Mark-Simulacrum commentedon Nov 18, 2016
It looks like I was wrong with my initial assessment about rustc being the only one to show the increase, but this graph shows that it has the largest increase by far out of most rustc crates in that pass.
eddyb commentedon Nov 19, 2016
I'd suggest comparing with callgrind: if the number of calls related to inference, for example, change, well... My suspicion is basically "impl children get checked twice" but then tests couldn't pass because errors would also be doubled? I'm not sure.
nnethercote commentedon Nov 21, 2016
nearest_common_ancestor
is at least part of the problem, according to Cachegrind. For example, from syntex:The 142M instructions executed is up from 124M. I've not seen
nearest_common_ancestor
in any profiles prior to today.If the problem can't be found soon I suggest reverting #37660.
nikomatsakis commentedon Nov 21, 2016
So I did some experimentation with a small test file: it's certainly not as simple as something in typeck happening twice, or at least if it is I didn't figure out what yet.
@nnethercote's samples suggest something about region inference, but we are not running regionck more often, as far as I can tell (nor typeck). Or at least we don't do so on a very simple test case. I will try experimenting with some bigger ones.
I'm not ready to revert yet. Please consult with me before considering such a thing.
nikomatsakis commentedon Nov 21, 2016
OK, I may have found the culprit.
nikomatsakis commentedon Nov 21, 2016
Fix in #37920
nnethercote commentedon Nov 21, 2016
I wouldn't presume to revert, but my statement was intended to mark the beginning of such a consultation :)
retep998 commentedon Nov 22, 2016
winapi was totally hit by this.
https://gist.github.com/Arnavion/ddcd1af4dc3393b35fa0f11c5dc3119e
Arnavion commentedon Nov 22, 2016
And I confirmed that #37920 fixes winapi build times back to ~35s, the same that it takes with stable.
Auto merge of #37920 - nikomatsakis:compile-time-regression-37864, r=mw
Auto merge of #37920 - nikomatsakis:compile-time-regression-37864, r=mw
Auto merge of #37920 - nikomatsakis:compile-time-regression-37864, r=mw
nnethercote commentedon Dec 5, 2016
I remeasured and I can confirm the regression is fixed. Performance on rustc-benchmarks is basically equivalent to what it was on Nov 14, my last measurement prior to the regression.
michaelwoerister commentedon Dec 5, 2016
🎉