-
Notifications
You must be signed in to change notification settings - Fork 13k
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
NLL performance tracking issue #47879
Comments
I did some profiling of syn. The top result was actually not what I expected:
This is type-checker constraint collection; this may imply that some of the refactorings I had in mind for doing this in a smarter way are in order. |
OK, that profiling run was kind of messed up, because I forgot to include |
On a hunch, tried the results of @Aaron1011's #47920. This makes a big difference, bringing us down to 7s. Haven't looked at the detailed profiling yet. |
Did some rough profiling and analysis. For syn, with #47920 applied:
|
So after #48411 lands, this is the current profile of the syn crate:
This is showing stuff that takes more than 2% of total execution time. Here is the profile showing stuff that takes more than 1%: 1% profile
|
Good news: The indomitable @Mark-Simulacrum has added a special "NLL mode" to http://perf.rust-lang.org/, so we can now visualize our performance very easily. The NLL point should be compared to "clean" -- the delta is the 'extra work' we are doing when NLL is enabled (note that NLL still runs the old region analysis and borrow check, so it does strictly more work). Bad news: We got out work cut out for us! =) See that little orange triangle in the upper right? |
I'm gonna close this tracking issue. Not that the problem is solved, but I don't see this issue as adding a lot of value. |
This is a tracking issue dedicated to discussing ideas and techniques for improving compile-time with the NLL feature. It's meant to house as a repository of measurements, benchmarks, etc for the time being to help coordinate efforts.
Benchmarks and timing runs
We can view performance results on perf.rust-lang.org now. Just look for the "NLL" runs. They can be compared against "clean" runs -- the delta is the 'extra work' we are doing when NLL is enabled (note that NLL still runs the old region analysis and borrow check, so it does strictly more work).
Ideas for improvement or measurement
dfs
calls wind up actually adding new info?dfs
code not to invokesuccessors()
, which can allocate, but instead add some kind of non-allocating form (perhaps with a callback?)Quick pointers into the source
The main source of time for NLL is probably going to be the code that propagates constraints:
rust/src/librustc_mir/borrow_check/nll/region_infer/mod.rs
Lines 453 to 457 in fe7e1a4
And in particular the calls to
dfs
:rust/src/librustc_mir/borrow_check/nll/region_infer/mod.rs
Lines 486 to 495 in fe7e1a4
The
dfs
code must walk the graph to find which points should be added and where:rust/src/librustc_mir/borrow_check/nll/region_infer/dfs.rs
Lines 37 to 40 in fe7e1a4
cc @rust-lang/wg-compiler-nll
The text was updated successfully, but these errors were encountered: