Skip to content

[PERF] More collect and apply #141652

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

I saw that we have quite a few collect_and_apply calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 27, 2025
@compiler-errors
Copy link
Member Author

@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 May 27, 2025
@@ -402,6 +402,51 @@ impl<T, R> CollectAndApply<T, R> for T {
assert!(iter.next().is_none());
f(&[t0, t1])
}
(3, Some(3)) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

this could be a macro

bors added a commit that referenced this pull request May 27, 2025
[PERF] More collect and apply

I saw that we have quite a few `collect_and_apply` calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.
@bors
Copy link
Collaborator

bors commented May 27, 2025

⌛ Trying commit 618a3b0 with merge 23b0844...

@bors
Copy link
Collaborator

bors commented May 27, 2025

☀️ Try build successful - checks-actions
Build commit: 23b0844 (23b0844997f3003800cd6bf24365e11d353a5709)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (23b0844): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
0.6% [0.1%, 1.3%] 27
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 6
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.1%] 19
All ❌✅ (primary) 0.3% [-0.2%, 3.0%] 7

Max RSS (memory usage)

Results (primary 1.7%, secondary 4.2%)

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.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
6.1% [1.2%, 9.8%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.9% [-2.5%, -1.2%] 3
All ❌✅ (primary) 1.7% [1.7%, 1.7%] 1

Cycles

Results (primary 2.7%, secondary 2.7%)

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.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
2.7% [1.3%, 3.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

Results (primary 1.1%)

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.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Bootstrap: 780.158s -> 784.918s (0.61%)
Artifact size: 366.33 MiB -> 368.72 MiB (0.65%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 28, 2025
@compiler-errors compiler-errors force-pushed the more-collect-and-apply branch from 618a3b0 to 8180ed0 Compare May 31, 2025 10:08
@compiler-errors
Copy link
Member Author

@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 May 31, 2025
@bors
Copy link
Collaborator

bors commented May 31, 2025

⌛ Trying commit 8180ed0 with merge 4997545...

bors added a commit that referenced this pull request May 31, 2025
[PERF] More collect and apply

I saw that we have quite a few `collect_and_apply` calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

};

let Some(t2) = iter.next() else {
return f(&[t1]);
Copy link
Member Author

Choose a reason for hiding this comment

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

lol

@bors
Copy link
Collaborator

bors commented May 31, 2025

💔 Test failed - checks-actions

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 31, 2025
@compiler-errors compiler-errors force-pushed the more-collect-and-apply branch from 8180ed0 to e311c75 Compare May 31, 2025 10:34
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 1, 2025

⌛ Trying commit e311c75 with merge e582a3d

rust-bors bot added a commit that referenced this pull request Jun 1, 2025
[PERF] More collect and apply

I saw that we have quite a few `collect_and_apply` calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.
@rust-bors
Copy link

rust-bors bot commented Jun 1, 2025

☀️ Try build successful (CI)
Build commit: e582a3d (e582a3daad87838574e3805e1708c269b5684437)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e582a3d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 6
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.5% [-1.2%, -0.2%] 29
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results (primary 0.8%, secondary 1.8%)

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)
3.3% [2.2%, 4.2%] 5
Regressions ❌
(secondary)
2.7% [0.4%, 9.0%] 27
Improvements ✅
(primary)
-5.5% [-9.3%, -1.7%] 2
Improvements ✅
(secondary)
-1.0% [-2.1%, -0.4%] 8
All ❌✅ (primary) 0.8% [-9.3%, 4.2%] 7

Cycles

Results (secondary -0.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)
0.7% [0.4%, 1.0%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-2.3%, -0.5%] 6
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.8%)

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)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) - - 0

Bootstrap: 775.511s -> 782.887s (0.95%)
Artifact size: 372.29 MiB -> 374.56 MiB (0.61%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 1, 2025
@@ -440,6 +454,51 @@ impl<T, R, E> CollectAndApply<T, R> for Result<T, E> {
assert!(iter.next().is_none());
f(&[t0, t1])
}
(3, Some(3)) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

oh shoot i should've changed this too lmao

@compiler-errors compiler-errors force-pushed the more-collect-and-apply branch from e311c75 to 42aacf4 Compare June 2, 2025 01:31
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

⌛ Trying commit 42aacf4 with merge c80db40

rust-bors bot added a commit that referenced this pull request Jun 2, 2025
[PERF] More collect and apply

I saw that we have quite a few `collect_and_apply` calls for N=3-7 (N=7 corresponding to cumulative 99% of nalgebra's calls). Didn't perf locally, but also this is super low-pri, so let's see what rust-timer says.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 2, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

☀️ Try build successful (CI)
Build commit: c80db40 (c80db4002515430c35018ea3d5c3b3b782f54dd8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c80db40): comparison URL.

Overall result: ✅ improvements - no 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.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 6
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 5
Improvements ✅
(secondary)
-0.6% [-1.3%, -0.4%] 48
All ❌✅ (primary) -0.3% [-0.4%, -0.2%] 5

Max RSS (memory usage)

Results (primary -1.6%, secondary 0.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)
- - 0
Regressions ❌
(secondary)
1.9% [0.6%, 10.0%] 12
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.5% [-5.3%, -0.4%] 5
All ❌✅ (primary) -1.6% [-1.6%, -1.6%] 1

Cycles

Results (secondary 0.1%)

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.0% [0.4%, 2.1%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-5.0%, -0.8%] 4
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 743.462s -> 749.816s (0.85%)
Artifact size: 372.27 MiB -> 371.77 MiB (-0.13%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

5 participants