Uh oh!
There was an error while loading. Please reload this page.
Don't enqueue onto a disabled dep_graph. - #36973
Conversation
nikomatsakis
commented
Oct 5, 2016
I used to have this setup, but I changed it to the current one specifically so that the shadow graph was active even if incremental is disabled. This is because it detects common errors that are otherwise overlooked (at least until people are using incremental by default). Perhaps we could do this setup, but only if debug-assertions are not enabled? |
michaelwoerister
commented
Oct 5, 2016
FYI: As far as I know, debug assertions are always enabled on the build bots. |
TimNN
commented
Oct 5, 2016
@michaelwoerister: I think it's the exact opposite (at least on the stable/beta/nightly build bots): |
michaelwoerister
commented
Oct 5, 2016
@TimNN I might not be using the right terminology. What I meant was that the tests that gate whether a PR gets merged are run using a compiler where debug assertions are enabled. |
TimNN
commented
Oct 5, 2016
Ah well, I suppose those are build bots as well. (Not sure if there is an "official" terminology). (And I just checked, |
michaelwoerister
commented
Oct 5, 2016
@TimNN Thanks for making facts out of my speculations |
nnethercote
commented
Oct 5, 2016
Ok, I will update the code to still push the messages if debug assertions are enabled. |
nnethercote
commented
Oct 6, 2016
There was a problem hiding this comment.
Have you measured the impact of this on the perf also when construction is enabled? When I first wrote the code, I went to some lengths to make it straightline and cheap when the graph was enabled, and the overhead I measured was quite low. The idea was that copying into the buffer without a branch could actually be cheaper than not copying at all. I did measure and I recall finding this to be the case (I think I tested libsyntax), but a lot has changed since then, and for all I know my measurements at the time were flawed. =) We have a better setup now.
(After all, we do expect "incremental enabled" to be the common case, right? I would think that incr will always be on, unless you are building a final release artifact, in which case you are already asking for a lot of time to be spent on optimization.)
nnethercote
commented
Oct 11, 2016
The only measurement of incremental compilation I did is of |
nikomatsakis
commented
Oct 11, 2016
Seems good. @bors r+ |
bors
commented
Oct 11, 2016
📌 Commit d54b044 has been approved by |
alexcrichton
commented
Oct 13, 2016
@bors: r- Unfortunately I think this caused this failure, specifically: This happened on MSVC for me but not on Linux, and I had to take it out of a rollup as a result. |
This commit guards all calls to `DepGraphThreadData::enqueue` with a check to make sure it is enabled. This requires distinguishing between a "fully enabled" and an "enqueue-enabled" graph. This change avoids some useless allocation and vector manipulations when the graph is disabled (i.e. when incremental compilation is off) which improves speed by ~1% on some of the rustc-benchmarks.
nnethercote
commented
Oct 18, 2016
I've fixed the problem and pushed an updated commit. The problem was that I mistakenly removed the the enabled check in |
nikomatsakis
commented
Oct 19, 2016
@bors r+ |
bors
commented
Oct 19, 2016
📌 Commit cde42cd has been approved by |
bors
commented
Oct 20, 2016
⌛ Testing commit cde42cd with merge eb38d42... |
Don't enqueue onto a disabled dep_graph. This commit guards all calls to `DepGraphThreadData::enqueue` with a check to make sure it is enabled. This avoids some useless allocation and vector manipulations when it is disabled (i.e. when incremental compilation is off) which improves speed by 1--2% on most of the rustc-benchmarks. This commit has an observable functional change: when the dep_graph is disabled its `shadow_graph` will no longer receive messages. This should be ok because these message are only used when debug assertions are enabled. r? @nikomatsakis
This commit guards all calls to
DepGraphThreadData::enqueuewith acheck to make sure it is enabled. This avoids some useless allocation
and vector manipulations when it is disabled (i.e. when incremental
compilation is off) which improves speed by 1--2% on most of the
rustc-benchmarks.
This commit has an observable functional change: when the dep_graph is
disabled its
shadow_graphwill no longer receive messages. This shouldbe ok because these message are only used when debug assertions are
enabled.
r? @nikomatsakis