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

cache type sizes in type-size limit visitor #127288

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Conversation

lqd
Copy link
Member

@lqd lqd commented Jul 3, 2024

This is basically #125507 (comment) as lcnr can't open the PR now.

Locally it reduces the itertools regression by quite a bit, to "only +50%" compared to nightly (that includes overhead from the local lack of artifact post-processing, and is just a data point to compare to the 10-20x timings without the cache).

Benchmark 1: cargo +stage1 build --release
  Time (mean ± σ):      2.721 s ±  0.009 s    [User: 2.446 s, System: 0.325 s]
  Range (min … max):    2.710 s …  2.738 s    10 runs

Benchmark 2: cargo +nightly build --release
  Time (mean ± σ):      1.784 s ±  0.005 s    [User: 1.540 s, System: 0.279 s]
  Range (min … max):    1.778 s …  1.792 s    10 runs

Summary
  cargo +nightly build --release ran
    1.52 ± 0.01 times faster than cargo +stage1 build --release

On master, it's from 34s to the 2.7s above.

r? compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 3, 2024
@lqd
Copy link
Member Author

lqd commented Jul 3, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 3, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
cache type sizes in type-size limit visitor

This is rust-lang#125507 (comment) as lcnr can't open the PR now.

Locally it reduces the `itertools` regression by quite a bit, "only +50%" compared to nightly.

```console
Benchmark 1: cargo +stage1 build --release
  Time (mean ± σ):      2.721 s ±  0.009 s    [User: 2.446 s, System: 0.325 s]
  Range (min … max):    2.710 s …  2.738 s    10 runs

Benchmark 2: cargo +nightly build --release
  Time (mean ± σ):      1.784 s ±  0.005 s    [User: 1.540 s, System: 0.279 s]
  Range (min … max):    1.778 s …  1.792 s    10 runs

Summary
  cargo +nightly build --release ran
    1.52 ± 0.01 times faster than cargo +stage1 build --release
```

On master, it's from 34s to the 2.7s above.

r? compiler-errors just as a cc, as they said they might open the same PR later

Opening as draft to do a perf run to see `deeply-nested-multi` (which should be fixed on the perf server now), and validate bootstrap times.
@bors
Copy link
Contributor

bors commented Jul 3, 2024

⌛ Trying commit 96312fb with merge 9ac628f...

@rust-log-analyzer

This comment was marked as resolved.

@rust-log-analyzer

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2024
@lqd
Copy link
Member Author

lqd commented Jul 3, 2024

The joys of --keep-stage 1 and not running tests 👍 .

@bors try

@bors
Copy link
Contributor

bors commented Jul 3, 2024

⌛ Trying commit 529a3f4 with merge 83217ae...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
cache type sizes in type-size limit visitor

This is rust-lang#125507 (comment) as lcnr can't open the PR now.

Locally it reduces the `itertools` regression by quite a bit, "only +50%" compared to nightly.

```console
Benchmark 1: cargo +stage1 build --release
  Time (mean ± σ):      2.721 s ±  0.009 s    [User: 2.446 s, System: 0.325 s]
  Range (min … max):    2.710 s …  2.738 s    10 runs

Benchmark 2: cargo +nightly build --release
  Time (mean ± σ):      1.784 s ±  0.005 s    [User: 1.540 s, System: 0.279 s]
  Range (min … max):    1.778 s …  1.792 s    10 runs

Summary
  cargo +nightly build --release ran
    1.52 ± 0.01 times faster than cargo +stage1 build --release
```

On master, it's from 34s to the 2.7s above.

r? compiler-errors just as a cc, as they said they might open the same PR later

Opening as draft to do a perf run to see `deeply-nested-multi` fixed on the perf server (the type length has been bumped), and validate bootstrap times.
@bors
Copy link
Contributor

bors commented Jul 3, 2024

☀️ Try build successful - checks-actions
Build commit: 83217ae (83217ae97e94eb43ce31396b49a938608f7f9c06)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (83217ae): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.3%] 8
Regressions ❌
(secondary)
0.6% [0.5%, 0.8%] 3
Improvements ✅
(primary)
-1.3% [-1.6%, -0.5%] 4
Improvements ✅
(secondary)
-99.4% [-99.8%, -99.1%] 6
All ❌✅ (primary) -0.3% [-1.6%, 0.3%] 12

Max RSS (memory usage)

Results (primary 2.0%, secondary 2.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
3.1% [1.5%, 4.7%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

Cycles

Results (primary 1.8%, secondary -99.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.8% [1.8%, 1.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-99.0% [-99.6%, -98.6%] 6
All ❌✅ (primary) 1.8% [1.8%, 1.8%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 742.585s -> 701.096s (-5.59%)
Artifact size: 327.63 MiB -> 327.61 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 4, 2024
@lqd lqd marked this pull request as ready for review July 4, 2024 07:45
@lqd
Copy link
Member Author

lqd commented Jul 4, 2024

This should be ready to review, as at least a first step to reduce the problem.

deeply-nested-multi works via bumping the limit, and back closer to regular numbers with this caching: from the last PR where it worked

image
image

itertools looks to be back to the expected range in the bootstrap numbers: from

image
image

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 4, 2024
@compiler-errors
Copy link
Member

comparison url using the start of #125507's perf run and the end is this commit. Looks like we fixed everything unless I just can't read?

https://perf.rust-lang.org/compare.html?start=2db4ff40af2b9f93b6240dbd67ed7f2f34b19776&end=83217ae97e94eb43ce31396b49a938608f7f9c06&stat=instructions:u

@compiler-errors
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jul 4, 2024

📌 Commit 529a3f4 has been approved by compiler-errors

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 4, 2024
@bors
Copy link
Contributor

bors commented Jul 4, 2024

⌛ Testing commit 529a3f4 with merge cc8da78...

@bors
Copy link
Contributor

bors commented Jul 4, 2024

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing cc8da78 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 4, 2024
@bors bors merged commit cc8da78 into rust-lang:master Jul 4, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 4, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cc8da78): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.3%] 9
Regressions ❌
(secondary)
0.7% [0.6%, 0.8%] 3
Improvements ✅
(primary)
-1.3% [-1.6%, -0.4%] 4
Improvements ✅
(secondary)
-85.4% [-99.8%, -1.9%] 7
All ❌✅ (primary) -0.2% [-1.6%, 0.3%] 13

Max RSS (memory usage)

Results (primary -2.0%, secondary 1.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [0.8%, 2.9%] 6
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-1.2% [-1.7%, -0.8%] 2
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Cycles

Results (secondary -98.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-98.9% [-99.6%, -98.5%] 6
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 721.419s -> 698.879s (-3.12%)
Artifact size: 328.24 MiB -> 328.27 MiB (0.01%)

@lqd lqd deleted the typelen-cache branch July 5, 2024 06:13
@Kobzol
Copy link
Contributor

Kobzol commented Jul 9, 2024

Resolved a perf. regression from #125507.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jul 9, 2024
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

7 participants