-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Crate graph resolution on parity-wasm with a lockfile is noticeably slow #5817
Comments
Thanks for the cc, I am happy to help. The next step IMO is to run the problematic invocation in a profiler perf/wpr and see where we are spending the time. I can't promise when I can get to reproducing hear. |
I took a quick look. It looks like there is a massive slowdown starting in 1.27. I don't think it is graph resolution, which is not significantly different. Things like |
I did some rough measurements of time-to-first-compile.
The last one is a hacked version where I replaced Profile in There is a lot of variability due to caching. These numbers are after running once. The first run can be up to 2s before it starts. It's hard to nail down due to the variability. It might be interesting to do more detailed profiling. About 0.15s of the startup time is updating git submodules. Resolve is about 0.15 to 0.2. Not sure if this is helpful at all... |
Thanks for digging in @ehuss! My profile attempts on OSX didn't show the profile bits as being too much time, but I primarily saw: I think the largest time here is basically spent in loading crates from the registry, which isn't uncommon for crates I've seen depending on lots of crates from crates.io In that sense resolution itself may not be taking much time here, but rather things like reading the registry and parsing/walking git repositories (lots of git deps in this lock file) |
Note that going from ~.50s -> ~0.6s is consistent with spending ~15% in Not that I know how to make it faster. |
Following alexcrichton/cargo-vendor#89 I cloned the parity-ethereum repository and ran
cargo build
, but on subsequent tries, much to my surprise, it took a noticeably long time for Cargo to start printing "Compiling ..."!This typically means that Cargo is spending too long in crate graph resolution, although it could be other things! Very unscientific testing shows ~.8s before "Compiling..." shows up on nightly. Interestingly
CARGO_PROFILE=1
only shows ~100ms ms (!!) in resolution.We may be able to do much better in this regard! cc @Eh2406, would you be curious to dig into this?
The text was updated successfully, but these errors were encountered: