So @Wesley Wiser, wycats was asking me about aggregating self-profile data across multiple crates.
They're creating a Zulip account now.
I know that if you do
RUSTFLAGS=-Zself-profile you'll get a separate data file for each crate you build
( cc @Yehuda Katz )
but is there a tool that combines the output from multiple crates to give you an overall view? At least I think that is what @Yehuda Katz is asking for
what I'm trying to do is figure out what parts of
nu are contributing to build slowness
You can take a look at
-Ztimings in Cargo which gives a super high level view (timings per crate, split into 'metadata' and 'codegen')
There is also this tool that @Eric Huss wrote, I think?
Ah, maybe that's it
but that won't help at all if you're interested in "which functions in this crate are causing slowness"
I will just reiterate that man do we need some docs to point people at on this
that we can't answer ~at all today
I'm first interested in which deps
that's good enough for now
okay, then -Ztimings is your best bet for deps I think today
will try it out
should be a matter of
cargo build -Ztimings (or any other cargo command that builds things, in theory)
that'll print out a message at the end pointing at an HTML file which gives you a couple graphs and is generally helpful for this question
sadly there's currently a nightly regression that's making my build not work but I can wait for that to be reverted
you could also pop back to an earlier nightly, @Yehuda Katz
(or use an earlier nightly -- this functionality has been in and pretty stable for a month or two)
I'm not totally sure which one works
cargo-bisect-rustc can help there, in theory :)
cargo-bisect-rustccan help there, in theory :)
heh interesting application
I never quite have any idea what I'm doing :P
Very soon, you'll be able to do something similar with the measureme data. @mw just released measureme 0.5 this morning and we need to update it in rustc.
how does measureme work?
At that point, the
crox tool can generate the same kind of visualization as cargo timings but more detailed.
We have hooks in the compiler (mostly around the query system but also a few other areas) which record "interesting" events. The data is dumped in a binary format to some files in your working directory. Then after the compilation session, we have set of tools you can use to inspect the files.
Once firstname.lastname@example.org lands in rustc, you'll be able to generate performance traces like this https://github.com/rust-lang/measureme/pull/84#issuecomment-552688721
I think @mw is opening a PR tomorrow so we should be able to do that in nightlies starting later this week.