-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[self-profiling] Include the estimated size of each cgu in the profile #78702
Conversation
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
This is helpful when looking for CGUs where the size estimate isn't a good indicator of compilation time. I verified that moving the profiling timer call doesn't affect the results.
0832de5
to
efe703a
Compare
let _prof_timer = tcx.prof.generic_activity_with_args( | ||
"codegen_module", | ||
&[cgu_name.to_string(), cgu.size_estimate().to_string()], | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this now excludes the codegen_unit query -- is that intentional? I guess the query was always pre-executed which is why results are not affected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codegen_unit
query was already invoked just before running the task of module_codegen
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but previously that was included in the timer here I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the query is certainly run before this point so the only difference is the fast query lookup and the fact the query is run inside this activity instead of right before it. I don't think moving the query out of the activity is significant so that seemed fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. Thanks!
@bors r+ |
📌 Commit efe703a has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#74293 (Rustdoc test compiler output color) - rust-lang#78702 ([self-profiling] Include the estimated size of each cgu in the profile) - rust-lang#79069 (Get rid of `highlight::Class::None`) - rust-lang#79072 (Fix exhaustiveness in case a byte string literal is used at slice type) - rust-lang#79120 (update rustfmt to v1.4.27) - rust-lang#79125 (Get rid of clean::{Method, TyMethod}) - rust-lang#79126 (Remove duplicate `Trait::auto` field) - rust-lang#79130 (extend macro braces test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This is helpful when looking for CGUs where the size estimate isn't a
good indicator of compilation time.
I verified that moving the profiling timer call doesn't affect the
results.
Results:
measureme
doesn't have support for custom arg names yet soarg0
is the CGU name andarg1
is the estimated size.