Dep-graph loading (#62083)

design meeting 2019-10-11

Zulip stream

introduction

Dear @T-compiler/meeting,

Today we will be having a design meeting. The topic was originally sketched as “some Zoxc PR”. We’ve since narrowed that down to discuss #62038, which is a refactoring to how dep-graph loading occurs. @Zoxc wrote up a comment giving a summary of the ideas. Note that this PR itself is an incremental step towards #60035, which aims to make dep-graph loading/saving more continuous.

I’d also like to discuss briefly how we should document these changes. We currently have some rustc-chapters on incremental compilation (e.g., this chapter goes into detail). I would like to move us to a world where major refactorings like #60035 (but not limited to this one – I think e.g. my recent PR and work on lazy norm fits the bill) come along with a rustc-dev-guide chapter that documents the new state of the world. Maybe we discuss some how that might work and – in the case of THIS PR – who might do that documentation work (I don’t necessarily think it has to be @Zoxc, though they’re also an obvious candidate). (In my ideal world, drafts of that chapter would be available before the PR, but at minimum I think such a chapter should be in place to help with reviewing.)

Questions for discussion

  • “This is where the performance gain of this PR is.”, have we measured this at all? – nikomatsakis
    • Here are some measurements. However, are they done against a single-threaded or parallel compiler? -mw
    • The results show some improvements and some regressions.
  • “The one possible performance drawback is that ids can become fragmented since this PR requires us to reuse ids from the previous session.” – in what way is this a performance drawback? Do we have any mechanism to reuse ids or ‘reset’ state after a suitable amount of time?
  • There is another possible performance drawback: The current dep-graph has to be built two times in the worst case (i.e. full cache, but all invalid). Is that correct?

Minutes and notes from discussion