Skip to content

mono-item profiler #1016

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

Merged
merged 1 commit into from
Sep 27, 2021
Merged

Conversation

Mark-Simulacrum
Copy link
Member

This adds another profiler which runs the benchmark with -Zprint-mono-items and then slightly parses the output to split into per-CGU lists of mono items. These are the post-merging CGUs.

Posting this to get it merged into master; I'm using this locally to mediocre success but I feel like it is probably at least a little useful to have. Eventually I'd like to work some more on it and get this displayed as part of our results on each benchmark, so we can e.g. give warnings when CGU allocation changes. Potentially there's some useful work to show the "forest" of CGUs that got merged into the final set as well, but I am not sure that is genuinely helpful (vs. pretty).

@bjorn3
Copy link
Member

bjorn3 commented Sep 18, 2021

Potentially there's some useful work to show the "forest" of CGUs that got merged into the final set as well, but I am not sure that is genuinely helpful (vs. pretty).

I can see that be useful when trying to figure out why the cgu merging has changed.

Copy link
Contributor

@tgnottingham tgnottingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to add an entry for mono-items to collector/README.md.

Copy link
Member

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as a start! Thanks 🎉

let _ = fs::create_dir_all(&out_dir);
let result_file = filepath(&out_dir, "raw");

fs::copy(&tmp_file, &result_file)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these result files severed from the site or is this currently only useable locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all just usable locally, the perf collector server doesn't hit this function at all, I believe.

Eventually I'd like to surface this specific profile in the site - potentially integrated with the recently added codegen schedule graphs - but that's future work.

@Mark-Simulacrum Mark-Simulacrum merged commit 4e21bf3 into rust-lang:master Sep 27, 2021
@Mark-Simulacrum Mark-Simulacrum deleted the mono-items branch September 27, 2021 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants