Skip to content
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

Instrument accesses to the HIR Map #31304

Merged
merged 5 commits into from
Feb 5, 2016

Conversation

nikomatsakis
Copy link
Contributor

This change also modifies the dep graph infrastructure to keep track of the number of active tasks, so that even if we are not building the full dep-graph, we still get assertions when there is no active task and one does something that would add a read/write edge. This is particularly helpful since, if the assertions are not active, you wind up with the error happening in the message processing thread, which is too late to know the correct backtrace.

Before landing, I need to do some performance measurements. Those are underway.

See measurements below. No real effect on time.

r? @michaelwoerister

@bors
Copy link
Contributor

bors commented Feb 2, 2016

☔ The latest upstream changes (presumably #31250) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor Author

So I did some measurements to judge the effect of the various changes:

  1. Tracking whether a dep-graph item is pushed or not all the time
  2. Instrumenting HIR map

These are based on measuring times for libsyntax.

version plain -Z incr-comp
master 1:59s 1:59s
branch 2:00s 2:00s

So, basically, none.

@nikomatsakis
Copy link
Contributor Author

Note: I don't have any tests here because I'm not aware of a particular test that would fail at the moment thanks to the use of the HIR map.

@nikomatsakis
Copy link
Contributor Author

But it still seems clear it should be instrumented. :)

// This function reveals the name of the item and hence is a
// kind of read. This is inefficient, since it walks ancestors
// and we are walking them anyhow, but whatever.
self.read(id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I've changed my mind about this one: The read should be there. If something depends on the name, it must be invalidated by a name change. The only thing different when changing the name (as opposed to changing some other part of the item) is that the change will look to the system like them item was removed instead of altered. But that does not change the fact that we need the edge to properly invalidate things depending on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelwoerister I seem to recall going through a very similar line of thinking when I wrote that call in the first place; maybe I will expand the comment a bit.

@michaelwoerister
Copy link
Member

Looking good :)
r=me with the nits adressed.

@nikomatsakis
Copy link
Contributor Author

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Feb 5, 2016

📌 Commit a0f96d6 has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented Feb 5, 2016

⌛ Testing commit a0f96d6 with merge 34af2de...

bors added a commit that referenced this pull request Feb 5, 2016
…chaelwoerister

This change also modifies the dep graph infrastructure to keep track of the number of active tasks, so that even if we are not building the full dep-graph, we still get assertions when there is no active task and one does something that would add a read/write edge. This is particularly helpful since, if the assertions are *not* active, you wind up with the error happening in the message processing thread, which is too late to know the correct backtrace.

~~Before landing, I need to do some performance measurements. Those are underway.~~

See measurements below. No real effect on time.

r? @michaelwoerister
@bors bors merged commit a0f96d6 into rust-lang:master Feb 5, 2016
bors added a commit that referenced this pull request Feb 18, 2016
Make the dep. graph edges created by variance just mirror the constraint graph.

Note that this extends <#31304>, so the first few commits are on a different topic.

r? @pnkfelix
@nikomatsakis nikomatsakis deleted the incr-comp-read-from-hir-map branch March 30, 2016 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants