Stream: t-compiler/wg-nll

Topic: optimizing-old-skool-rustc


nikomatsakis (May 18 2018 at 13:36, on Zulip):

this is a placeholder thread to go on discussion why the location insensitive rustc is still taking too long to compile clap; see older notes in the making-more-plans thread

nikomatsakis (May 18 2018 at 15:16, on Zulip):

ok I spent some time looking at why the type check is so expensive

nikomatsakis (May 18 2018 at 15:16, on Zulip):

I think I have a fix

nikomatsakis (May 18 2018 at 15:17, on Zulip):

in particular the vast majority of that time seems to be allocating some vectors we don't have to be allocating

nikomatsakis (May 18 2018 at 15:17, on Zulip):

but I'll have to tweak the ena API

nikomatsakis (May 18 2018 at 15:17, on Zulip):

should be easy though

nikomatsakis (May 18 2018 at 15:18, on Zulip):

@David Wood or @Chris Vittal — either of you, feel free to ping me if you want to help out with other optimization efforts on rustc (as opposed to polonius hacking)

nikomatsakis (May 18 2018 at 15:18, on Zulip):

(or anybody :)

davidtwco (May 18 2018 at 15:18, on Zulip):

I'm more than happy to work on that if that's where the work is needed.

nikomatsakis (May 18 2018 at 15:20, on Zulip):

ok I'm about to step out but I think that a good thing to do would be to look into how we can make kill_loans_out_of_scope_at_location faster

nikomatsakis (May 18 2018 at 15:20, on Zulip):

right now, it is very simplistic:

nikomatsakis (May 18 2018 at 15:20, on Zulip):

it iterates over all borrows and checks whether they are out of scope at a given location

nikomatsakis (May 18 2018 at 15:20, on Zulip):

this is pretty dumb

nikomatsakis (May 18 2018 at 15:21, on Zulip):

I'm not 100% sure what would be better ;) but I can think of at least some things

nikomatsakis (May 18 2018 at 15:21, on Zulip):

e.g., for each borrow, we could compute the set of transition points Q where:

nikomatsakis (May 18 2018 at 15:22, on Zulip):

if we kept an index like Q -> [L] where Q is some point and [L] is the set of borrows (loans) that have a transition point Q,

nikomatsakis (May 18 2018 at 15:22, on Zulip):

then kill_loans_out_of_scope_at_location could just lookup in that set

nikomatsakis (May 18 2018 at 15:22, on Zulip):

I'll be back in a few minutes, gotta walk to the subway

nikomatsakis (May 18 2018 at 15:47, on Zulip):

ok on subway now :)

nikomatsakis (May 18 2018 at 15:47, on Zulip):

I'm not sure if what I just proposed really makes sense

nikomatsakis (May 18 2018 at 15:47, on Zulip):

it's not obvious to me how to build said map

nikomatsakis (May 18 2018 at 15:47, on Zulip):

but it feels like there has to be a faster way to do what we are doing

nikomatsakis (May 18 2018 at 15:47, on Zulip):

it occurs to me that if we did migrate to SEME regions (current system is not using them) they might enable a faster way to detect these transition points

Chris Vittal (May 18 2018 at 17:02, on Zulip):

@nikomatsakis I'm fine with either polonius hacking, or rustc hacking. What's there to do?

nikomatsakis (May 18 2018 at 17:03, on Zulip):

well so @pnkfelix and I were talking earlier. The TL;DR is that we should try to polish rustc "as is" but keep things moving with polonius. That way we can integrate at our leisure.

nikomatsakis (May 18 2018 at 17:03, on Zulip):

as far as rustc goes, there are two bottlenecks:

nikomatsakis (May 18 2018 at 17:03, on Zulip):

one of them I had planned to tackle right now

nikomatsakis (May 18 2018 at 17:04, on Zulip):

though I would be happy to mentor it out also :) it involves adding a feature to ena

nikomatsakis (May 18 2018 at 17:04, on Zulip):

I'm kind of incline dto just do it though

nikomatsakis (May 18 2018 at 17:04, on Zulip):

since it will take me as long to describe as to do =)

nikomatsakis (May 18 2018 at 17:04, on Zulip):

and I'd like to see how much faster it will go

nikomatsakis (May 18 2018 at 17:04, on Zulip):

the other is the kill_loans_out_of_scope_at_location thing I was talking about above; I'm not sure the best plan there

nikomatsakis (May 18 2018 at 17:05, on Zulip):

oh heh that's sort of funny

nikomatsakis (May 18 2018 at 17:06, on Zulip):

looking in my local clone of ena I see I had already started the changes I had in mind

nikomatsakis (May 18 2018 at 17:06, on Zulip):

and just forgotten about it

nikomatsakis (May 18 2018 at 19:13, on Zulip):

nikomatsakis (May 18 2018 at 19:14, on Zulip):

ok so on the topic of kill_loans_out_of_scope_at_location

nikomatsakis (May 18 2018 at 19:14, on Zulip):

@David Wood and I did a quick chat to cover background, which I will post, but it remains not entirely obvious to me how to do this better

nikomatsakis (May 18 2018 at 19:14, on Zulip):

at least one thing @David Wood that came up is that we should try just calling it less often

davidtwco (May 18 2018 at 19:14, on Zulip):

(not entirely sure that I came up with it, but sure)

nikomatsakis (May 18 2018 at 19:15, on Zulip):

well it came up anyway :)

nikomatsakis (May 18 2018 at 19:15, on Zulip):

want to give that a shot and see what breaks?

nikomatsakis (May 18 2018 at 19:15, on Zulip):

I suspect we only need the calls from before_{statement,terminator}_effect

davidtwco (May 18 2018 at 19:15, on Zulip):

Sure thing.

nikomatsakis (May 18 2018 at 19:15, on Zulip):

I can't yet see how it could be otherwise..

nikomatsakis (May 19 2018 at 09:21, on Zulip):

@David Wood two things.

1. we should open a rustc issue. I'll do that, and then leave some more detailed notes.
2. I was thinking about this later and I think probably the best we can do to compute the kills for each borrow is like this:

This is not how the current dataflow framework is setup, though: it wants to walk and, at each point, ask you: should I have a gen/kill bit here?

I think there are other APIs though we could use for this, but if not, we could do that walk and build up a datastructure to use later (basically a map P -> Vec<L> of killed borrows)

nikomatsakis (May 19 2018 at 09:22, on Zulip):

I suspect this will be a big win even in "theoretically" it doesn't feel that much better

davidtwco (May 19 2018 at 09:24, on Zulip):

Alright, great. (I've still been running into some issues getting rustc to compile - not sure what's changed in my setup or in rustc since I last compiled it, but after I've got that sorted I'll be looking at this).

davidtwco (May 19 2018 at 13:47, on Zulip):

@nikomatsakis I'm not seeing any errors on run-pass or compile-fail after calling from only before_{statement, terminator}_effect.

nikomatsakis (May 19 2018 at 13:52, on Zulip):

maybe open a PR then :) r? me or pnkfelix...

davidtwco (May 19 2018 at 14:37, on Zulip):

Sure thing.

davidtwco (May 19 2018 at 14:41, on Zulip):

https://github.com/rust-lang/rust/pull/50891

davidtwco (May 20 2018 at 11:55, on Zulip):

@nikomatsakis did you open an issue for this?

nikomatsakis (May 21 2018 at 12:46, on Zulip):

no sorry I should do that

nikomatsakis (May 21 2018 at 12:46, on Zulip):

@David Wood which is your PR btw ?

davidtwco (May 21 2018 at 12:48, on Zulip):

https://github.com/rust-lang/rust/pull/50891

nikomatsakis (May 21 2018 at 12:56, on Zulip):

ok @David Wood filed https://github.com/rust-lang/rust/issues/50934

pnkfelix (May 21 2018 at 12:57, on Zulip):

thanks @David Wood , I r+'ed rust-lang/rust#50891 in the meantime

nikomatsakis (May 21 2018 at 12:57, on Zulip):

@pnkfelix silly question, but does the MIR dataflow code have the option of adding a kill bit to an arbitrary point P?

nikomatsakis (May 21 2018 at 12:58, on Zulip):

right now, it usually does some kind of walk and invokes statement_effect to learn this information

davidtwco (May 21 2018 at 12:58, on Zulip):

Thanks. I'll take a look into that issue a little later today.

pnkfelix (May 21 2018 at 12:58, on Zulip):

@nikomatsakis right, we only keep per-block info globally

nikomatsakis (May 21 2018 at 12:58, on Zulip):

anyway maybe add some notes about that to #50934

nikomatsakis (May 21 2018 at 12:58, on Zulip):

hmm ok right

pnkfelix (May 21 2018 at 12:58, on Zulip):

@nikomatsakis and rely on the client to reconstruct any intra-block effect

nikomatsakis (May 21 2018 at 12:58, on Zulip):

well ok

nikomatsakis (May 21 2018 at 12:58, on Zulip):

I guess all that means is

nikomatsakis (May 21 2018 at 12:58, on Zulip):

we should — in the BorrowSet or some such place — build up an index

nikomatsakis (May 21 2018 at 12:59, on Zulip):

that we can consult in the Borrows iterator

pnkfelix (May 21 2018 at 12:59, on Zulip):

an index of what? Is this something for rust-lang/rust#50934 ?

nikomatsakis (May 21 2018 at 13:00, on Zulip):

yes

nikomatsakis (May 21 2018 at 13:00, on Zulip):

right now, to figure out which loans go out of scope at some location L,

nikomatsakis (May 21 2018 at 13:00, on Zulip):

we iterate over all loans

nikomatsakis (May 21 2018 at 13:00, on Zulip):

and check if L is in their region

nikomatsakis (May 21 2018 at 13:00, on Zulip):

the best improvement I can think of (maybe you can think of a better one!) is to instead do a DFS starting from the point of each borrow

nikomatsakis (May 21 2018 at 13:01, on Zulip):

and then keep a map Location -> Set<BorrowIndex>

nikomatsakis (May 21 2018 at 13:01, on Zulip):

which basically stores the locations where each borrow went out of scope

nikomatsakis (May 21 2018 at 13:01, on Zulip):

this is still O(N^2) but you are only walking over the points actually in each borrow

nikomatsakis (May 21 2018 at 13:03, on Zulip):

anyway, @David Wood , left more notes here

davidtwco (May 21 2018 at 13:03, on Zulip):

Great, thanks.

nikomatsakis (May 21 2018 at 13:04, on Zulip):

btw over the weekend my PR #50874 landed which seems to have been a 10-20% win overall — I'm looking to see what's the next bottle neck in the typeck

nikomatsakis (May 21 2018 at 13:04, on Zulip):

I think it's still in that general area

nikomatsakis (May 22 2018 at 14:13, on Zulip):

@pnkfelix speaking of topic hygiene, jfyi we can discuss how to improve kill_loans_out_of_scope_at_location here I suppose =)

pnkfelix (May 22 2018 at 14:13, on Zulip):

ah true

pnkfelix (May 22 2018 at 14:14, on Zulip):

okay I've re-read https://github.com/rust-lang/rust/issues/50934 ; it basically amounts to trying to precompute the kill-set on the Borrows for each location

pnkfelix (May 22 2018 at 14:14, on Zulip):

(IIUC)

nikomatsakis (May 22 2018 at 14:14, on Zulip):

yeah nothing too clever

nikomatsakis (May 22 2018 at 14:14, on Zulip):

I'm just banking it would be faster

nikomatsakis (May 22 2018 at 14:15, on Zulip):

tbh I didn't quite understand what you were proposing

nikomatsakis (May 22 2018 at 14:15, on Zulip):

but maybe I have to (re-)read the source first

pnkfelix (May 22 2018 at 14:17, on Zulip):

well I think I didn't understand everything here at first

pnkfelix (May 22 2018 at 14:20, on Zulip):

(namely I misread the code and thought we were iterating over a bitset in the outer loop. But we're actually iterating, as you have said repeatedly, all of the registered borrows.)

pnkfelix (May 22 2018 at 14:20, on Zulip):

you know: While we need to do the full iteration when we are setting up the initial gen and kill sets

pnkfelix (May 22 2018 at 14:21, on Zulip):

once the dataflow equations are solved

pnkfelix (May 22 2018 at 14:21, on Zulip):

we should be able to just iterate over the bits set to 1 in the block sets, right?

pnkfelix (May 22 2018 at 14:21, on Zulip):

/me goes to double-check if we actually call these methods after the dataflow has been run

nikomatsakis (May 22 2018 at 14:22, on Zulip):

we should be able to just iterate over the bits set to 1 in the block sets, right?

yes, this was something else I wanted to consider doing

nikomatsakis (May 22 2018 at 14:22, on Zulip):

but then I was thinking that — if we pre-compute the sets we need — it hardly matters anyway, right?

pnkfelix (May 22 2018 at 14:23, on Zulip):

it does matter

pnkfelix (May 22 2018 at 14:23, on Zulip):

because when we do the post-processing after dataflow has been solved

pnkfelix (May 22 2018 at 14:23, on Zulip):

we are calling reconstruct_statement_effect

pnkfelix (May 22 2018 at 14:24, on Zulip):

which, right now, calls into the code like before_statement_effect

nikomatsakis (May 22 2018 at 14:24, on Zulip):

yes, I know, but the set of borrows killed at that point are almost certainly the same set that are gen'd

nikomatsakis (May 22 2018 at 14:24, on Zulip):

unless you have a case like foo = ... which kills the borrow

pnkfelix (May 22 2018 at 14:24, on Zulip):

my point is that we are still iterating over the full index

pnkfelix (May 22 2018 at 14:24, on Zulip):

in the outer loop

pnkfelix (May 22 2018 at 14:24, on Zulip):

or do you think that isn't a problem?

nikomatsakis (May 22 2018 at 14:25, on Zulip):

to be clear, I am saying:

1. iterating only over the live borrows (in second phase) would be a win
but
2. if we had a Point -> Vec<Location> map (which we need anyway, probably?) then this might subsume that

nikomatsakis (May 22 2018 at 14:25, on Zulip):

but I agree that it would be a win

pnkfelix (May 22 2018 at 14:26, on Zulip):

sorry, is the Point -> Vec<Location> map ... is that the same as the side-index you propose in https://github.com/rust-lang/rust/issues/50934 ?

nikomatsakis (May 22 2018 at 14:26, on Zulip):

yes, that one

nikomatsakis (May 22 2018 at 14:26, on Zulip):

I guess we don't "have to do it"

pnkfelix (May 22 2018 at 14:26, on Zulip):

I am personally worried that any such table will be a space hog

nikomatsakis (May 22 2018 at 14:26, on Zulip):

just that, if we do it, it might subsume the other computation

nikomatsakis (May 22 2018 at 14:27, on Zulip):

hmm, I'd be surprised by that

nikomatsakis (May 22 2018 at 14:27, on Zulip):

keep in mind that this table would hvae far fewer kills than we currently create

pnkfelix (May 22 2018 at 14:27, on Zulip):

while the idea of "iterating over the live borrows" should be implementable with the state we are computing today

nikomatsakis (May 22 2018 at 14:27, on Zulip):

right now we kill every region that is out of scope at the point P

nikomatsakis (May 22 2018 at 14:27, on Zulip):

but that is "overkill" (no pun intended)

nikomatsakis (May 22 2018 at 14:27, on Zulip):

I am proposing that we only add a kill on the target Q of some edge P -> Q where P is in the region but Q is not

nikomatsakis (May 22 2018 at 14:28, on Zulip):

while the idea of "iterating over the live borrows" should be implementable with the state we are computing today

true

nikomatsakis (May 22 2018 at 14:28, on Zulip):

anyway I'm not opposed to doing that first if you think it's easy

nikomatsakis (May 22 2018 at 14:28, on Zulip):

and/or trying both

pnkfelix (May 22 2018 at 14:28, on Zulip):

hmm yes okay the kill-set would only have entries that are actually potentially gen'ed at some point that reaches that location

nikomatsakis (May 22 2018 at 14:28, on Zulip):

the other property I am banking on here is that kills for loans occur in two cases:

1. region ends
2. the borrowed path is reassigned

and I assume 2 is rare.

nikomatsakis (May 22 2018 at 14:29, on Zulip):

(meaning that the set of borrows being killed at any point will typically be equal to the set where region ends)

pnkfelix (May 22 2018 at 14:30, on Zulip):

(deleted)

nikomatsakis (May 22 2018 at 14:31, on Zulip):

(still if you think it's easy to take advantage of the fact that we're in second phase — I guess that just means adding a flag somewhere to communicate that? — let's indeed do that and measure perf!)

pnkfelix (May 22 2018 at 14:31, on Zulip):

Ah lets talk about it in the meeting tonight

pnkfelix (May 22 2018 at 14:31, on Zulip):

We're way over time

pnkfelix (May 22 2018 at 14:32, on Zulip):

I'm going to switch back to diagnostics review now

nikomatsakis (May 24 2018 at 00:44, on Zulip):

@David Wood these are the perf results from your PR — looking good! I'm assuming you didn't get a chance to look at the further improvements?

nikomatsakis (May 24 2018 at 00:44, on Zulip):

we're still quite a bit slower doing clap check (NLL vs clean, for example)

nikomatsakis (May 24 2018 at 00:50, on Zulip):

current profile information:

thing percent (total)
MIR borrowck 24%
└ compute_regions 10%
│└ type_check_internal 8%
└ do_dataflow 6%
│└ kill_loans_out_of_scope_at_location 5%
kill_loans_out_of_scope_at_location(total) 10%
davidtwco (May 24 2018 at 10:27, on Zulip):

I haven't yet, sadly. I fully intend to but getting ready to move is taking more time than I anticipated.

davidtwco (May 27 2018 at 10:19, on Zulip):

@nikomatsakis I've submitted https://github.com/rust-lang/rust/pull/51106 for #50934. It has a rough implementation of what you described and it builds, but it's failing some tests and I've not had a chance to look into that yet. Apologies for the delay on getting around to this.

nikomatsakis (May 28 2018 at 10:23, on Zulip):

@David Wood thanks! I'll take a look shortly

davidtwco (May 28 2018 at 21:44, on Zulip):

@nikomatsakis Looking at the current error I'm getting on that PR and I'm struggling to work out the root cause.

nikomatsakis (May 28 2018 at 23:51, on Zulip):

@David Wood ok I'll take a look tomorrow

nikomatsakis (May 29 2018 at 08:56, on Zulip):

@David Wood I think I'll just have to build it. That said, I think we could optimize this DFS quite a bit (and I can leave a few tips on that if you want). But I don't see an obvious problem yet.

nikomatsakis (May 29 2018 at 08:56, on Zulip):

er, maybe I do... I'll leave some comments

davidtwco (May 29 2018 at 09:00, on Zulip):

@nikomatsakis Thanks, I'll take a look as soon as I get a chance.

nikomatsakis (May 29 2018 at 09:05, on Zulip):

@David Wood left a review but I'm not sure if I found the problem per se

nikomatsakis (May 29 2018 at 09:06, on Zulip):

interestingly, I was profiling the webrender build and it looks like MIR borrowck is only 4%

nikomatsakis (May 29 2018 at 09:07, on Zulip):

but on perf it seems to show significant overhead

nikomatsakis (May 29 2018 at 09:07, on Zulip):

maybe we're not measuring the same thing somehow

davidtwco (May 29 2018 at 09:07, on Zulip):

Thanks, that's great.

lqd (May 29 2018 at 09:09, on Zulip):

I had the same issue trying to see what made webrender slow on Friday

nikomatsakis (May 29 2018 at 09:19, on Zulip):

looking via time I see 20s vs 18s or so... (from a single run) idk

davidtwco (May 29 2018 at 17:25, on Zulip):

@nikomatsakis Pushed up a commit that addresses those points - not sure what I was thinking when I did the initial implementation, should have been much cleaner.

davidtwco (May 29 2018 at 17:25, on Zulip):

Noticed locally that it is still causing that error, but on even more tests.

nikomatsakis (May 29 2018 at 17:26, on Zulip):

I guess that's progress =)

nikomatsakis (May 29 2018 at 17:27, on Zulip):

I do think it's possible for this to change behavior, but I would have expected (I think) fewer errors, not more

nikomatsakis (May 29 2018 at 17:28, on Zulip):

(or I could imagine it anyway)

nikomatsakis (May 29 2018 at 17:28, on Zulip):

I'll try to do a local build I suppose to see what's going on

davidtwco (May 29 2018 at 17:29, on Zulip):

It seems like some part of the code after this is expecting there to be more errors than there now are.

nikomatsakis (May 29 2018 at 17:30, on Zulip):

ok. So I could imagine that you end up with a borrow like &'X foo where 'X encompasses not only some points reachable from the borrow but also some that are not

nikomatsakis (May 29 2018 at 17:30, on Zulip):

and this new code would not include those in the borrow

nikomatsakis (May 29 2018 at 17:30, on Zulip):

that said

nikomatsakis (May 29 2018 at 17:30, on Zulip):

hmm

nikomatsakis (May 29 2018 at 17:30, on Zulip):

I guess I don't think that should change behavior really

nikomatsakis (May 29 2018 at 17:30, on Zulip):

will have to investigate

nikomatsakis (May 29 2018 at 17:30, on Zulip):

(i.e., because before we would have had a GEN at the borrow, and a KILL when you exit the region, and no subsequent GEN)

davidtwco (May 29 2018 at 17:31, on Zulip):

I also noticed that on some tests, there were more errors.

davidtwco (May 29 2018 at 17:31, on Zulip):

Anecdotally it seemed like that only happened when generators were involved.

davidtwco (May 29 2018 at 17:31, on Zulip):

But 90% of the failures were the same error as before.

nikomatsakis (May 29 2018 at 17:33, on Zulip):

interesting ok

davidtwco (May 29 2018 at 17:36, on Zulip):

I'm just not sure where to start in tracing the effect of the change I'm making through to the region inference code that's failing to try and identify what it is expecting.

nikomatsakis (May 29 2018 at 17:36, on Zulip):

ok, I'm doing a local build — but if you want me to take a look faster, posting the output and -Zdump-mir=nll results from a test would help

davidtwco (May 29 2018 at 17:43, on Zulip):

@nikomatsakis https://gist.github.com/davidtwco/e408a382d1af2822eeacebff93315ff8

nikomatsakis (May 29 2018 at 17:44, on Zulip):

ok, issue-45697.rsis not a generator example :)

davidtwco (May 29 2018 at 17:45, on Zulip):

No, that's one of the "couldn't find a constraint to blame" ones.

nikomatsakis (May 29 2018 at 17:46, on Zulip):

ah, I see. ok

davidtwco (May 29 2018 at 17:46, on Zulip):

There's only a handful of generator ones and the rest are like that.

nikomatsakis (May 29 2018 at 17:47, on Zulip):

it might be helpful @David Wood to include the "kill locations" in the mir-dump output

nikomatsakis (May 29 2018 at 17:47, on Zulip):

in some form or other

davidtwco (May 29 2018 at 17:48, on Zulip):

Is that a functionality that exists already?

nikomatsakis (May 29 2018 at 17:48, on Zulip):

is what?

nikomatsakis (May 29 2018 at 17:48, on Zulip):

I mean mir-dump exists

nikomatsakis (May 29 2018 at 17:48, on Zulip):

we'd have to extend it to include this info

nikomatsakis (May 29 2018 at 17:49, on Zulip):

that...could be hard

nikomatsakis (May 29 2018 at 17:49, on Zulip):

just because of the way the phasing works out

nikomatsakis (May 29 2018 at 17:49, on Zulip):

probably easier would be to dump some info with RUST_LOG for now ;)

nikomatsakis (May 29 2018 at 17:49, on Zulip):

tl;dr I'd like to know:

nikomatsakis (May 29 2018 at 17:50, on Zulip):

that said, I have a local build now

davidtwco (May 29 2018 at 17:50, on Zulip):

Ah, I wasn't sure if there was a flag existing that would output the kill locations with the dump.

nikomatsakis (May 29 2018 at 17:52, on Zulip):

not that I know of

nikomatsakis (May 29 2018 at 17:53, on Zulip):

it's ok I'm doing a local build with the debug! I want

nikomatsakis (May 29 2018 at 17:53, on Zulip):

man I really want to refactor the borrow check sometimes :)

nikomatsakis (May 29 2018 at 17:53, on Zulip):

not exactly sure how

nikomatsakis (May 29 2018 at 17:53, on Zulip):

I just feel like the code is cruftier than it should be for its age ;)

nikomatsakis (May 29 2018 at 17:53, on Zulip):

but we'll wait until polonius is done I guess

nikomatsakis (May 29 2018 at 17:53, on Zulip):

in particular i'd love to have really smooth debugging etc :) we have a lot of it...

nikomatsakis (May 29 2018 at 17:53, on Zulip):

...but also borrow_check/mod.rs is too big

davidtwco (May 29 2018 at 17:59, on Zulip):

Yeah, it's a bit hard to browse without ack or ctags.

nikomatsakis (May 29 2018 at 18:03, on Zulip):

do you mind if I push a few minor things to your branch @David Wood ?

nikomatsakis (May 29 2018 at 18:03, on Zulip):

/me does it anyway

davidtwco (May 29 2018 at 18:03, on Zulip):

@nikomatsakis go ahead

nikomatsakis (May 29 2018 at 18:03, on Zulip):

so based on the debugging statements I added, I see:

nikomatsakis (May 29 2018 at 18:04, on Zulip):
DEBUG 2018-05-29T18:01:13Z: rustc_mir::dataflow::impls::borrows: borrow bw2 starts at bb0[13]
DEBUG 2018-05-29T18:01:13Z: rustc_mir::dataflow::impls::borrows: borrow bw2 gets killed at bb1[0]
nikomatsakis (May 29 2018 at 18:04, on Zulip):

this seems to be the problem: in particular, if you look at the MIR, there ought to be some kills along the non-unwind path

nikomatsakis (May 29 2018 at 18:04, on Zulip):

I think your new DFS is a bit too efficient =)

nikomatsakis (May 29 2018 at 18:05, on Zulip):

that is, you jump from a location like BB1[2] to BB1[N] where N is the end without visiting the points in between sort of

nikomatsakis (May 29 2018 at 18:05, on Zulip):

that may be the problem

davidtwco (May 29 2018 at 18:06, on Zulip):

Ah!

davidtwco (May 29 2018 at 18:06, on Zulip):

That explains why there are more errors.

davidtwco (May 29 2018 at 18:06, on Zulip):

I did that before.

nikomatsakis (May 29 2018 at 18:07, on Zulip):

yeah so in this case I think that bb4[1] ought to be a kill point too

nikomatsakis (May 29 2018 at 18:07, on Zulip):

since the region in question:

| '_#5r    | {bb0[8..=15], bb2[0..=3], bb3[0..=2], bb4[0]}
nikomatsakis (May 29 2018 at 18:07, on Zulip):

ends at bb4[0]

nikomatsakis (May 29 2018 at 18:07, on Zulip):

also, we should add that to the debug! — that is, the value of the borrow region

nikomatsakis (May 29 2018 at 18:07, on Zulip):

would've been useful

davidtwco (May 29 2018 at 18:17, on Zulip):

Building locally with it visiting each statement and not just the terminators - like it did originally.

nikomatsakis (May 29 2018 at 18:21, on Zulip):

ok

davidtwco (May 29 2018 at 18:38, on Zulip):

Seems like with that change, there are even more errors! Well, that's not strictly true, while lots of tests are erroring, it's because the compiler isn't erroring when we expect it to.

nikomatsakis (May 29 2018 at 18:41, on Zulip):

heh:)

nikomatsakis (May 29 2018 at 18:41, on Zulip):

did you push said change?

davidtwco (May 29 2018 at 18:41, on Zulip):

Just did.

nikomatsakis (May 29 2018 at 18:52, on Zulip):

@David Wood what's an example test that fails?

davidtwco (May 29 2018 at 18:52, on Zulip):

drop-may-dangle should fail, it doesn't.

davidtwco (May 29 2018 at 18:52, on Zulip):

that is, ui/nll/drop-may-dangle.

nikomatsakis (May 29 2018 at 19:00, on Zulip):

@David Wood actually... I think that test should pass

nikomatsakis (May 29 2018 at 19:01, on Zulip):

note:

// compile-flags:-Zborrowck=mir
// compile-pass
davidtwco (May 29 2018 at 19:03, on Zulip):

@nikomatsakis Oops, read drop-may-no-dangle wrong.

nikomatsakis (May 29 2018 at 19:10, on Zulip):

@David Wood pushed a few more things, including one bug fix, running tests locally

davidtwco (May 29 2018 at 19:12, on Zulip):

@nikomatsakis Sounds good - sorry about being a bit useless with this one, not sure where my head is at.

nikomatsakis (May 29 2018 at 19:16, on Zulip):

with that fix @David Wood it passes src/test/ui

nikomatsakis (May 29 2018 at 19:17, on Zulip):

./x.py test --stage 1 src/test/ui

davidtwco (May 29 2018 at 19:17, on Zulip):

Oh, great.

nikomatsakis (May 29 2018 at 21:41, on Zulip):

@David Wood I'm going to profile your branch btw

davidtwco (May 29 2018 at 21:44, on Zulip):

Awesome - looking forward to seeing how it does.

nikomatsakis (May 30 2018 at 00:19, on Zulip):

@David Wood based on my profiles, that PR seems to drop MIR borrowck from 24% of the total down to 16% — kill_loans_out_of_scope_at_location is not visible, and the pre-computation cost seems cheap. I'm doing another build with some #[inline(never)] calls to help me isolate that, but I am hopeful this will be a decent win.

nikomatsakis (May 30 2018 at 00:19, on Zulip):

The big cost seems to be the type check again

nikomatsakis (May 30 2018 at 00:21, on Zulip):
Phase Percent of total
MIR Borrowck 16%
- Type check 8%
- - take_and_reset_obligations 4%
- Dataflow 2%
nikomatsakis (May 30 2018 at 00:21, on Zulip):

not sure what the other 6% are yet

nikomatsakis (May 30 2018 at 00:23, on Zulip):

I didn't measure the raw time before/after, which would be useful of course... I'll guess we'll see it from perf though

davidtwco (May 30 2018 at 06:01, on Zulip):

Nice.

nikomatsakis (May 30 2018 at 12:40, on Zulip):

ok @David Wood your branch landed, the effects are not yet visible on perf but we should keep our eye on it

nikomatsakis (May 30 2018 at 12:40, on Zulip):

there are however a bunch of new tests on perf — it's clear we're not "out of the woods" yet I would say

davidtwco (May 30 2018 at 13:04, on Zulip):

I saw that it landed.

lqd (May 30 2018 at 15:08, on Zulip):

here are the perf.rlo results btw

nikomatsakis (May 30 2018 at 15:08, on Zulip):

oh, nice!

nikomatsakis (May 30 2018 at 15:09, on Zulip):

pretty solid win

nikomatsakis (May 30 2018 at 15:09, on Zulip):

still, the disparate impact (e.g., on webrender etc) shows that we gotta start profiling other crates...

lqd (May 30 2018 at 15:10, on Zulip):

hmm simulacrum sent another link on discord which is not yet available, that was the initial one on GH ...

nikomatsakis (May 30 2018 at 15:10, on Zulip):

one is probably from the try run

nikomatsakis (May 30 2018 at 15:10, on Zulip):

versus the final merge

nikomatsakis (May 30 2018 at 15:11, on Zulip):

interesting that we are still seeing clap-rs be like 50% slower with NLL

lqd (May 30 2018 at 15:11, on Zulip):

oh yes, so this one must be the try build

nikomatsakis (May 30 2018 at 15:11, on Zulip):

the (NLL - clean) / NLL value is 32%— I have to check what %age is borrowck_mir

nikomatsakis (May 30 2018 at 15:12, on Zulip):

I feel like it was significantly less than that

nikomatsakis (May 30 2018 at 15:12, on Zulip):

which indicates some other source of overhead

nikomatsakis (May 30 2018 at 15:12, on Zulip):

right, before I posted this:

Phase Percent of total
MIR Borrowck 16%
- Type check 8%
- - take_and_reset_obligations 4%
- Dataflow 2%
nikomatsakis (May 30 2018 at 15:12, on Zulip):

so where is that other 16%?

nikomatsakis (May 30 2018 at 16:03, on Zulip):

it's interesting that @Reed Koser's PR appears to have led to a small perf regression

nikomatsakis (May 30 2018 at 16:03, on Zulip):

I don't know why exactly that is

nikomatsakis (May 30 2018 at 16:03, on Zulip):

probably not worth worrying about

Reed Koser (May 30 2018 at 16:22, on Zulip):

Huh, probably caused LLVM to miss some inter-procedural optimizations? That PR also introduced a number of extra DefID/tcx copies so if those weren't eliminated they could explain it. I guess we should remember to fold all that code back together once Polonius borrowck lands properly

nikomatsakis (May 30 2018 at 16:23, on Zulip):

yeah, maybe something like that. it's prety much in the noise anyway.

nikomatsakis (May 30 2018 at 16:24, on Zulip):

I wish a regression like that mattered :)

nikomatsakis (May 30 2018 at 16:24, on Zulip):

ah well actually

nikomatsakis (May 30 2018 at 16:24, on Zulip):

8% on clap is not nothing

nikomatsakis (May 30 2018 at 16:24, on Zulip):

I was looking at the wrong column =)

nikomatsakis (May 30 2018 at 16:24, on Zulip):

5% on clap, I guess, 8% on clap-check

nikomatsakis (May 30 2018 at 16:24, on Zulip):

either way, maybe worth investigating

Reed Koser (May 30 2018 at 16:26, on Zulip):

:+1:

nikomatsakis (May 31 2018 at 00:02, on Zulip):

btw y'all note the new http://perf.rust-lang.org/nll-dashboard.html that helps to get a (numeric) picture of how much slower NLL is at any given commit

nikomatsakis (May 31 2018 at 00:02, on Zulip):

seems like we should investigate inflate :)

Jake Goulding (May 31 2018 at 03:11, on Zulip):

What's 1000% among friends

lqd (May 31 2018 at 05:38, on Zulip):

while inflate is a special case IIRC, an older version of the crate which contained a lot of macro generated code, some of that overhead must be present in the other benchmarks :)

lqd (May 31 2018 at 05:39, on Zulip):

I'll look at its NLL facts later today

lqd (May 31 2018 at 06:40, on Zulip):

(oops I don't have a rustc with debuginfo here, making valgrind/callgrind unhappy :3 — however there is one slow function in -Ztime-passes: {{impl}}[3]::next_state)) which might be interesting to compare with polonius)

lqd (May 31 2018 at 07:26, on Zulip):

(so on this terrible machine 1) it's faster with datafrog_opt (I have high variance but seemed like 40%) 2) haven't tried leapfrog yet, 3) this fn passes the location-insensitive analysis, in around a 1/10th of the -Ztime-passes time)

nikomatsakis (May 31 2018 at 09:22, on Zulip):

interesting, but those two measurements aren't really directly comparable. The -Ztime-passes includes the overhead of MIR typeck etc, which we need regardless — that is, polonius only kicks in once it has the facts, but we still have to generate them.

lqd (May 31 2018 at 09:30, on Zulip):

yeah it was mostly another datapoint because I couldn't profile rustc then :)

nikomatsakis (May 31 2018 at 19:02, on Zulip):

I've been digging through profiles of clap and I see some stuff to do but not that much. Have to think about if there is a way to radically improve perf of the type-check — I see about a 12% (of total time) win. Not bad, but we'd need to make a 40% total time win to get it "as far as before" (at least on my machine, which does somewhat more evenly than the perf machine for reasons unknown)

Jake Goulding (May 31 2018 at 22:04, on Zulip):

Is this type checking new/unique to NLL world?

nikomatsakis (Jun 01 2018 at 08:34, on Zulip):

sort of, yes

nikomatsakis (Jun 01 2018 at 08:35, on Zulip):

we were doing some limited type-checking on MIR before, but only as a sanity check

nikomatsakis (Jun 01 2018 at 08:35, on Zulip):

still, this type-checking doesn't have to do the "hard work" of other type-checking. I have to dig into what is making it expensive more closely.

nikomatsakis (Jun 01 2018 at 15:51, on Zulip):

I've been doing some digging; I have to step out now but I see some promising leads I think

nikomatsakis (Jun 05 2018 at 18:05, on Zulip):

so @Reed Koser (or others) — looking a bit more at the profile from clap-rs, I see that access_place is 5% of total time

nikomatsakis (Jun 05 2018 at 18:06, on Zulip):

huh, actually this profile is kinda' weird

nikomatsakis (Jun 05 2018 at 18:07, on Zulip):

well, ok, some 8% is spent in visit_mir -- what is that I wonder ..

nikomatsakis (Jun 05 2018 at 18:09, on Zulip):

maybe it is replace_regions_in_mir ?

nikomatsakis (Jun 05 2018 at 18:09, on Zulip):

/me adds some #[inline(never)]

nikomatsakis (Jun 08 2018 at 14:10, on Zulip):

this branch is...getting long...

Unmerged into rust-lang/master (39)
04c83ed7f7 nll-perf-examination nikomatsakis/nll-perf-examination replace `LexicalRegionConstraintData` with `QueryRegionConstraint`
49aa9424e6 extract the handling of region constraints from queries
66f0ae9531 extract a helper for `make_query_result` that skips canonicalization
53766377eb move `make_query_response` into method on infcx
61b2470cbf break canonicalizer into submodules to make it easier to comprehend
cf156508c5 promote canonical into a module
ed774b1998 align the `type-op` outputs with what canonicalized queries give
e93fd74df5 mk `fully_perform_op_and_get_region_constraint_data` a TypeOp method
728a378715 remove the `TypeOp` vs `InfcxTypeOp` distinction
c461db2690 promote `type_op` into a `mod.rs` file
9eb1f11e92 introduce `DropckOutlives` type-op
84cb1929dd make `TypeOp` implement debug instead of carrying a closure
10e6db0d5b extract a `enabled` helper to remove some ad-hoc conditionals
56a47a3661 make `TypeOutlives` parameterized over a delegate
21c511efe9 obligations.rs: rustfmt
f384a7341f resolve type vars *before* entering `type_must_outlive`
6109ae6c7f create `InfcxTypeOp` that only depend on an `infcx`
af508f4f5c make normalize into an op
3152d8583b let `trivial_noop` take ownership of `self`
27546cc5a9 make `normalize` take ownership of the thing to be normalized
4253474fc8 introduce `prove_predicates` type op
c4fb817e1e introduce `trivial_noop` to accommodate micro-optimizations
9d0c0711d9 introduce `Eq` type-op
d42cddc61b introduce `Subtype` type_op
31fffa05e8 introduce `type_op`
e35a680d33 use `DUMMY_NODE_ID` as the `body_id` during NLL type-checking
9fa1f202c7 convert type-check constraints into NLL constraints on the fly
c1865024e6 rename `Constraint` to `OutlivesConstraint`
cecf8bb8c3 WIP Region constraint data method name
2988d98986 WIP region constraint data
cb8a0f6c52 key drop-data computation by ty, not var
1258830e83 update some tests affected by some of the prior tweaks
99edb16fdc cache the `dropck_outlives` computation per variable
752d850a3e extract out `fully_perform_op_and_get_constraint_constraints`
820f863122 put the `RegionConstraintData` into an `Rc`
ff5dc41868 librustc_mir/borrow_check/nll/type_check/mod.rs: rustfmt
50dbbaf04b micro-optimize empty predicate and normalize lists
82dcf52494 skip `eq_types` and `sub_types` when the two types are equal
a75c924b93 add some instrumentation
nikomatsakis (Jun 08 2018 at 14:10, on Zulip):

/me hopes this works

Jake Goulding (Jun 08 2018 at 15:06, on Zulip):

Poor reviewer

nikomatsakis (Jun 08 2018 at 15:07, on Zulip):

I'll make it easy for them. Just r+ it already.

nikomatsakis (Jun 08 2018 at 15:07, on Zulip):

Each step is quite self-contained, but it's a big transformation... I guess I could probably land some of these intermediate steps.

nikomatsakis (Jun 08 2018 at 15:07, on Zulip):

not an obvious win though

nikomatsakis (Jun 14 2018 at 12:54, on Zulip):

The perf results of my branch that adds a lot more caching are here — pretty decent. Worth landing on its own, though not yet as good as I hoped. That said, that branch has some pretty inefficient conversions of data back and forth that I hope to eliminate...

nikomatsakis (Jun 14 2018 at 12:59, on Zulip):

it's interesting though to look at the ones where this didn't help at all — e.g., syn

nikomatsakis (Jun 14 2018 at 12:59, on Zulip):

@lqd it may be worth revisiting the profile of syn

nikomatsakis (Jun 14 2018 at 12:59, on Zulip):

not sure if @Santiago Pastorino logged some notes on that, i'll have to check later

lqd (Jun 14 2018 at 13:01, on Zulip):

I don't think they did yet, according to the Paper document

Santiago Pastorino (Jun 14 2018 at 13:55, on Zulip):

hey, sorry, notes about what?

Santiago Pastorino (Jun 14 2018 at 13:56, on Zulip):

about syn?

nikomatsakis (Jun 14 2018 at 14:11, on Zulip):

yes

Santiago Pastorino (Jun 14 2018 at 15:51, on Zulip):

I can build that

Santiago Pastorino (Jun 14 2018 at 15:59, on Zulip):
[santiago@archlinux syn (master)]$ perf focus '{do_mir_borrowck}' --tree-callees --tree-min-percent 3
Matcher    : {do_mir_borrowck}
Matches    : 40
Not Matches: 173
Percentage : 18%

Tree
| matched `{do_mir_borrowck}` (18% total, 0% self)
: | rustc_mir::borrow_check::nll::compute_regions (14% total, 0% self)
: : | rustc_mir::borrow_check::nll::type_check::type_check (13% total, 0% self)
: : : | rustc_mir::borrow_check::nll::type_check::type_check_internal (13% total, 0% self)
: : : : | rustc_mir::borrow_check::nll::type_check::type_check::_$u7b$$u7b$closure$u7d$$u7d$::hf6df3047d9ec27be (9% total, 0% self)
: : : : : | rustc_mir::borrow_check::nll::type_check::liveness::generate (9% total, 0% self)
: : : : : : | rustc_mir::borrow_check::nll::type_check::TypeChecker::fully_perform_op (7% total, 0% self)
: : : : : : : | rustc::infer::InferCtxt::commit_if_ok (5% total, 0% self)
: : : : : : : : | rustc::traits::query::dropck_outlives::<impl rustc::infer::at::At<'cx, 'gcx, 'tcx>>::dropck_outlives (3% total, 0% self)
Santiago Pastorino (Jun 14 2018 at 16:08, on Zulip):

have updated the doc

Santiago Pastorino (Jun 14 2018 at 16:09, on Zulip):

btw, using a rustc build from june 6th

Santiago Pastorino (Jun 14 2018 at 16:09, on Zulip):

I can update if something important has happened

Santiago Pastorino (Jun 14 2018 at 17:12, on Zulip):

btw, have updated this thing and ran again

Santiago Pastorino (Jun 14 2018 at 17:13, on Zulip):
Matcher    : {do_mir_borrowck}
Matches    : 45
Not Matches: 145
Percentage : 23%

Tree
| matched `{do_mir_borrowck}` (23% total, 0% self)
: | rustc_mir::borrow_check::nll::compute_regions (17% total, 0% self)
: : | rustc_mir::borrow_check::nll::type_check::type_check (14% total, 0% self)
: : : | rustc_mir::borrow_check::nll::type_check::type_check_internal (14% total, 0% self)
: : : : | rustc_mir::borrow_check::nll::type_check::type_check::_$u7b$$u7b$closure$u7d$$u7d$::hf6df3047d9ec27be (12% total, 0% self)
: : : : : | rustc_mir::borrow_check::nll::type_check::liveness::generate (12% total, 0% self)
: : : : : : | rustc_mir::borrow_check::nll::type_check::TypeChecker::fully_perform_op (9% total, 1% self)
: : : : : : : | rustc::infer::InferCtxt::commit_if_ok (7% total, 0% self)
: : : : : : : : | rustc::traits::query::dropck_outlives::<impl rustc::infer::at::At<'cx, 'gcx, 'tcx>>::dropck_outlives (5% total, 0% self)
: : : : : : : : : | rustc::infer::canonical::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::instantiate_query_result (3% total, 0% self)
Santiago Pastorino (Jun 14 2018 at 17:13, on Zulip):

5% worser since june 6th

Santiago Pastorino (Jun 14 2018 at 17:13, on Zulip):

unsure about the standard deviation of what we are running

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

thanks!

Santiago Pastorino (Jun 14 2018 at 17:14, on Zulip):

should I run this several times and take an average?

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

nah

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

it looks fairly consistent

Santiago Pastorino (Jun 14 2018 at 17:14, on Zulip):

is it 5% worser for real?

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

interesting result

Santiago Pastorino (Jun 14 2018 at 17:14, on Zulip):

going to update the doc with the new date

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

I don't know? I don't really care :)

Santiago Pastorino (Jun 14 2018 at 17:14, on Zulip):

ok

nikomatsakis (Jun 14 2018 at 17:14, on Zulip):

I'm mostly interested in which parts of MIR borrowck

Santiago Pastorino (Jun 14 2018 at 17:14, on Zulip):

should I update the doc?

nikomatsakis (Jun 14 2018 at 17:15, on Zulip):

it is spending time in

nikomatsakis (Jun 14 2018 at 17:15, on Zulip):

I guess, I think it is not 5% worse

nikomatsakis (Jun 14 2018 at 17:15, on Zulip):

based on perf

Santiago Pastorino (Jun 14 2018 at 17:15, on Zulip):

yeah, I meant, I've already added june 6th results

Santiago Pastorino (Jun 14 2018 at 17:15, on Zulip):

do you prefer today's ones?

nikomatsakis (Jun 14 2018 at 17:15, on Zulip):

either is fine

Santiago Pastorino (Jun 14 2018 at 17:15, on Zulip):

ok

Santiago Pastorino (Jun 14 2018 at 17:15, on Zulip):

will leave as is then

nikomatsakis (Jun 14 2018 at 17:16, on Zulip):

they suggest that dropck_outlives is the big thing

nikomatsakis (Jun 14 2018 at 17:16, on Zulip):

which is interesting

nikomatsakis (Jun 14 2018 at 17:16, on Zulip):

but consistent with prior profiles of syn that I did

nikomatsakis (Jun 14 2018 at 17:16, on Zulip):

I am interested b/c i might've expected my branch to have more impact on that

lqd (Jun 14 2018 at 21:33, on Zulip):

I'm not seeing dropck_outlives with callgrind on syn(0.57% total, 0.15% self)

nikomatsakis (Jun 14 2018 at 21:35, on Zulip):

interesting

lqd (Jun 14 2018 at 21:36, on Zulip):

and the "biggest" NLL item that shows up by itself (there's a big cycle that is hard to untangle and understand) is the liveness::generate but only 4.5% total, 2% self

nikomatsakis (Jun 14 2018 at 21:37, on Zulip):

ok

lqd (Jun 14 2018 at 21:38, on Zulip):

NLL doesn't seem to be a whole lot worse than clean on syn

nikomatsakis (Jun 14 2018 at 21:40, on Zulip):

...huh.

nikomatsakis (Jun 14 2018 at 21:40, on Zulip):

ok

nikomatsakis (Jun 14 2018 at 21:40, on Zulip):

perf seems to think it's ~150%

lqd (Jun 14 2018 at 21:41, on Zulip):

for check right ?

lqd (Jun 14 2018 at 21:41, on Zulip):

on the compare page, for regular syn (non check) it's 13B to 16B, like 20%

lqd (Jun 14 2018 at 21:42, on Zulip):

with NLL being lower than the baseline incr

lqd (Jun 14 2018 at 21:45, on Zulip):

to be clear, I was looking at the regular non-check build, which is maybe not what niko and santiago were looking at (an maybe not that useful...)

lqd (Jun 14 2018 at 21:47, on Zulip):

I'll get the numbers for the check profile :)

nikomatsakis (Jun 14 2018 at 21:47, on Zulip):

for check right ?

yes, check

nikomatsakis (Jun 22 2018 at 14:20, on Zulip):

my branch I think is roughly ready to land. It seems to be a solid win but not totally transformative :( In that branch, typeck for clap is down to 7% though, and I see some further possible gains. (In comparison to 22% before). Total MIR time goes from 49% to 39%

nikomatsakis (Jun 22 2018 at 14:21, on Zulip):

I just wanted to get to 0% ;)

nikomatsakis (Jun 22 2018 at 14:21, on Zulip):

(there is still some cleanup work to do after that on the branch, in particular I think that an earlier PR of mine broke the futures crate when used with NLL, but I may put off the fix until a follow-up PR)

lqd (Jun 22 2018 at 14:28, on Zulip):

do we know if the MIR walks we're still doing are expensive ? and if we're maybe MIRwalking too much ?

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

this is a graph of the time spent in MIR borrowck

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

https://gist.github.com/nikomatsakis/4f4d962f906bffcc6d142838b5ef9f19

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

though it takes some time to learn how to interpret it

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

each percentage is an absolute figure of total execution time

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

and the labels on edges are the number of times that such an edge exists

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

it is not complete, just the top N functions

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

(this is the output of --graph-callees from perf-focus)

nikomatsakis (Jun 22 2018 at 15:03, on Zulip):

you can see that e.g. visit_statement_entry is 8%

nikomatsakis (Jun 22 2018 at 15:04, on Zulip):

a lot of which is mutate_place and access_place

nikomatsakis (Jun 22 2018 at 15:05, on Zulip):

@lqd (I'm not sure if that includes your branch or not)

lqd (Jun 22 2018 at 15:06, on Zulip):

nice graph :)

lqd (Jun 22 2018 at 15:12, on Zulip):

the 2 _place functions look interesting indeed

lqd (Jun 22 2018 at 15:14, on Zulip):

I was also wondering whether -Z two phase borrows had some speed implications (as IIRC perf.rlo only uses the MIR borrowck flag)

nikomatsakis (Jun 23 2018 at 01:33, on Zulip):

we should probably fix it; but I doubt it will have much impact

Last update: Nov 21 2019 at 13:45UTC