Skip to content
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

Remove new allocations from imported_source_files #99677

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

pietroalbini
Copy link
Member

#97786 introduced a large performance regression. After some local investigation it turns out the allocations performed by my change were the cause of the perf regression. This PR refactors my change to remove those allocations.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 24, 2022
@rust-highfive
Copy link
Collaborator

r? @wesleywiser

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2022
@pietroalbini
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 24, 2022
@bors
Copy link
Contributor

bors commented Jul 24, 2022

⌛ Trying commit f1063c0 with merge 5e5328706d3f8b491737daaf05f020e9fce2cc27...

@Mark-Simulacrum Mark-Simulacrum removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2022
@Mark-Simulacrum
Copy link
Member

r=me on the changes presuming perf looks good

@bors
Copy link
Contributor

bors commented Jul 24, 2022

☀️ Try build successful - checks-actions
Build commit: 5e5328706d3f8b491737daaf05f020e9fce2cc27 (5e5328706d3f8b491737daaf05f020e9fce2cc27)

@rust-timer
Copy link
Collaborator

Queued 5e5328706d3f8b491737daaf05f020e9fce2cc27 with parent b4151a4, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5e5328706d3f8b491737daaf05f020e9fce2cc27): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-1.5% -9.8% 125
Improvements 🎉
(secondary)
-3.8% -9.9% 60
All 😿🎉 (primary) -1.5% -9.8% 125

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.4% 4.9% 6
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.1% -2.1% 2
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.2% 2.2% 1
Improvements 🎉
(primary)
-3.3% -7.4% 19
Improvements 🎉
(secondary)
-5.3% -7.5% 27
All 😿🎉 (primary) -3.3% -7.4% 19

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 24, 2022
@pietroalbini
Copy link
Member Author

Ok the change seems to have resolved the performance regression (how many times is that function called to cause 3 allocations to have such impact?).

@bors r=Mark-Simulacrum rollup=never

@bors
Copy link
Contributor

bors commented Jul 24, 2022

📌 Commit f1063c0 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2022
@Kobzol
Copy link
Contributor

Kobzol commented Jul 25, 2022

(how many times is that function called to cause 3 allocations to have such impact?).

Just did a quick experiment, while compiling the clap crate (from scratch, so with all its dependencies), it gets called about a million times.

@bors
Copy link
Contributor

bors commented Jul 26, 2022

⌛ Testing commit f1063c0 with merge 96b9bb4...

@bors
Copy link
Contributor

bors commented Jul 26, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 96b9bb4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 26, 2022
@bors bors merged commit 96b9bb4 into rust-lang:master Jul 26, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (96b9bb4): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-1.5% -9.9% 132
Improvements 🎉
(secondary)
-3.2% -9.8% 77
All 😿🎉 (primary) -1.5% -9.9% 132

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.6% 4.1% 3
Improvements 🎉
(primary)
-2.5% -2.5% 1
Improvements 🎉
(secondary)
-2.2% -2.5% 3
All 😿🎉 (primary) -2.5% -2.5% 1

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-3.5% -7.7% 16
Improvements 🎉
(secondary)
-5.1% -7.4% 27
All 😿🎉 (primary) -3.5% -7.7% 16

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

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

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.

None yet

8 participants