Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

RLS takes to long to produce analysis #200

Closed
jrmuizel opened this issue Mar 2, 2017 · 9 comments
Closed

RLS takes to long to produce analysis #200

jrmuizel opened this issue Mar 2, 2017 · 9 comments

Comments

@jrmuizel
Copy link

jrmuizel commented Mar 2, 2017

STR:

  • Load up the webrender_traits project in VS Code
  • After every change RLS runs for a long time

Profile:

  • 41% rustc_save_analysis
    • 79% kernel write()
    • the rest is spread out quite a bit
  • 35% rustc_typeck::check_crate
  • 2% rustc_incremental::calculate_svh
@nrc
Copy link
Member

nrc commented Mar 2, 2017

Interesting profile. #25 should help with this by the sounds of things (I kind of assumed it wouldn't make so much difference, but this suggests it might).

@nrc
Copy link
Member

nrc commented Mar 2, 2017

cc @michaelwoerister I would assume that since we run in --emit=metadata mode, we shouldn't touch any incremental stuff (since we skip all of trans). Is the time in calculate_svh thus wasted? Can we turn that off easily?

@michaelwoerister
Copy link
Member

calculate_svh actually still calculates the SVH by hashing all the incremental hashes, so it's not trivial to switch this off. I'll see if I can find out where exactly the time is spent within calculate_svh.

On thing that might be easy is making sure that crates are compiled without debuginfo, because if debuginfo is turned on, spans are incorporated into the SVH which slows things down quite a bit since they have to be translated into a stable form before hashing.

@nrc
Copy link
Member

nrc commented Apr 3, 2017

With the latest commit, we are no longer writing and reading save-analysis results for the primary crate to disk. This should remove all the kernel write() calls from the profile and hopefully make the response here a bit quicker.

@jrmuizel if you have a minute to re-run your profile, I'd appreciate knowing if there is a change here. Also, how long does the RLS run for exactly?

@jrmuizel
Copy link
Author

jrmuizel commented Apr 3, 2017

RLS runs for about 5 seconds. rustc_save_analysis is now about 9% of that time.

Other interesting places in the profile:
5% in translate_to_llvm
20% in configure_and_expand
39% in type checking
4.5% in borrow checking

@jrmuizel
Copy link
Author

jrmuizel commented Apr 3, 2017

Note the percentages above are on a thread that takes 83% of the time. They would be scaled up if just looking at that thread.
The other thread is spending 15.3% of time in read_crate_data of which 76% of that time is in Json::from_str()

@jrmuizel
Copy link
Author

jrmuizel commented Apr 3, 2017

The numbers above are actually from the webrender crate and not webrender_traits. However, webrender_traits looks like it takes about 5 seconds to run as well.

@nrc
Copy link
Member

nrc commented Apr 4, 2017

Thanks for the data!

@nrc
Copy link
Member

nrc commented Oct 30, 2017

The main issue here is addressed. We still want to get faster, but I don't think we need to track that here.

@nrc nrc closed this as completed Oct 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants