Skip to content

Fixing #95444 by only displaying passes that take more than 5 millise… #95454

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
May 6, 2022

Conversation

randomicon00
Copy link
Contributor

As discussed in #95444, I have added the code to test and only display prints that are greater than 5 milliseconds.

r? @jyn514

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 30, 2022
@jyn514
Copy link
Member

jyn514 commented Mar 30, 2022

I bo longer have bors privileges.

r? @rylev

@jyn514
Copy link
Member

jyn514 commented Mar 30, 2022

Ah, apparently Ryan doesn't either. Maybe

r? @wesleywiser

would be a good fit?

@jyn514
Copy link
Member

jyn514 commented Mar 30, 2022

... I think only the PR author can reassign the reviewer.

@rust-log-analyzer

This comment has been minimized.

@randomicon00
Copy link
Contributor Author

randomicon00 commented Mar 30, 2022

Done.
r? @wesleywiser

@Dylan-DPC Dylan-DPC added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 30, 2022
@klensy
Copy link
Contributor

klensy commented Mar 30, 2022

For some reason i can't comment on original issue, so will here.

Help for this flag says, that: time-passes=val -- measure time of each rustc pass (default: no), so it should print time for each pass. Forcing it to print only passes filtered by some hardcoded value will break that contract.

@randomicon00
Copy link
Contributor Author

@klensy Your comment makes sense.
As I don't have a full understanding of the source code, can we please get the opinion of @jyn514? Thanks.

@jyn514
Copy link
Member

jyn514 commented Mar 30, 2022

We can just update the documentation to reflect the new behavior. I'm open to being convinced this isn't the right change but I don't think the comment is very compelling.

@jyn514
Copy link
Member

jyn514 commented Mar 30, 2022

Oh, we should probably include all passes that increase memory though, e.g. this one would be missed if we only go by CPU time:

time:   0.002; rss:   49MB ->   52MB (   +2MB)  parse_crate

@randomicon00
Copy link
Contributor Author

@jyn514 sure. I will make an update later today or tomrrow.

@wesleywiser
Copy link
Member

I'm not sure that a fixed cutoff like 5ms (or whatever) is going to be that useful in larger crates. As an extreme case, I doubt this would filter out any entries when compiling rustc_middle. However, switching to filtering based on a percentage of total time means there would be no output at all until the crate has finished compiling which seems very undesirable.

That being said, I don't really use -Ztime-passes at all so if people who are actually using it want this, I don't see any reason to hold this up.

@rust-log-analyzer

This comment has been minimized.

@randomicon00
Copy link
Contributor Author

randomicon00 commented Mar 31, 2022

@jyn514,@wesleywiser I've added the passes that increase memory. Any comments are, of course, welcome.
And thanks for providing me with this mentorship opportunity!

@randomicon00
Copy link
Contributor Author

Just a friendly reminder that I am still available for any changes needed.

@wesleywiser
Copy link
Member

There are a few tidy issues:

2022-03-30T21:23:39.1328047Z tidy error: /checkout/compiler/rustc_data_structures/src/profiling.rs:662: trailing whitespace
2022-03-30T21:23:39.1328594Z tidy error: /checkout/compiler/rustc_data_structures/src/profiling.rs:669: trailing whitespace
2022-03-30T21:23:39.1329092Z tidy error: /checkout/compiler/rustc_data_structures/src/profiling.rs:677: trailing whitespace

I think we can merge once these are taken care of. 🙂

@randomicon00
Copy link
Contributor Author

@wesleywiser I completed the requested changes.

@wesleywiser
Copy link
Member

Thanks, looks good! Would you mind squashing the commits together so we can merge?

@randomicon00 randomicon00 force-pushed the fix95444 branch 4 times, most recently from 82b1ce2 to e79ba76 Compare May 5, 2022 23:53
…5 milliseconds

95444: Adding passes that include memory increase

Fix95444: Change the substraction with the abs_diff() method

Fix95444: Change the substraction with abs_diff() method
@wesleywiser
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented May 6, 2022

📌 Commit e79ba76 has been approved by wesleywiser

@bors bors removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 6, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 6, 2022
@bors
Copy link
Collaborator

bors commented May 6, 2022

⌛ Testing commit e79ba76 with merge d60b4f5...

@bors
Copy link
Collaborator

bors commented May 6, 2022

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing d60b4f5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 6, 2022
@bors bors merged commit d60b4f5 into rust-lang:master May 6, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 6, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d60b4f5): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants