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

Small performance wins for Rc & Arc #113156

Closed

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 29, 2023

This branch is a perf experiment based on #89132 (Allocator API for Rc and Arc) with more inline indicators.

The results were successful so after #89132 lands, I will rebase this and open for review.

@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 29, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Jun 29, 2023

@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 Jun 29, 2023
@bors
Copy link
Contributor

bors commented Jun 29, 2023

⌛ Trying commit f7fcb93df6891e3b50e82a156a1b033a27b4d60f with merge 75d9a85e6d2bc257dee9d3c14a06743525de77ff...

@bors
Copy link
Contributor

bors commented Jun 29, 2023

☀️ Try build successful - checks-actions
Build commit: 75d9a85e6d2bc257dee9d3c14a06743525de77ff (75d9a85e6d2bc257dee9d3c14a06743525de77ff)

1 similar comment
@bors
Copy link
Contributor

bors commented Jun 29, 2023

☀️ Try build successful - checks-actions
Build commit: 75d9a85e6d2bc257dee9d3c14a06743525de77ff (75d9a85e6d2bc257dee9d3c14a06743525de77ff)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (75d9a85e6d2bc257dee9d3c14a06743525de77ff): 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
Regressions ❌
(secondary)
0.4% [0.3%, 0.5%] 3
Improvements ✅
(primary)
-0.5% [-0.7%, -0.4%] 5
Improvements ✅
(secondary)
-0.7% [-1.9%, -0.3%] 10
All ❌✅ (primary) -0.5% [-0.7%, -0.4%] 5

Max RSS (memory usage)

Results

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.4% [0.5%, 2.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.9% [-4.0%, -0.5%] 5
Improvements ✅
(secondary)
-1.4% [-1.6%, -1.3%] 2
All ❌✅ (primary) -0.6% [-4.0%, 2.2%] 8

Cycles

Results

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.4% [-0.4%, -0.4%] 2
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 2

Binary size

Results

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.2% [0.0%, 0.5%] 44
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 4
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 4
Improvements ✅
(secondary)
-3.0% [-3.5%, -1.5%] 4
All ❌✅ (primary) 0.2% [-0.1%, 0.5%] 48

Bootstrap: 661.126s -> 661.703s (0.09%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 29, 2023
@Mark-Simulacrum Mark-Simulacrum 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 1, 2023
@tgross35 tgross35 force-pushed the rc-allocator-support-perftests branch from f7fcb93 to 51bf2ff Compare August 4, 2023 01:45
@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 force-pushed the rc-allocator-support-perftests branch from 040c243 to d9e4868 Compare August 4, 2023 02:25
@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 force-pushed the rc-allocator-support-perftests branch from d9e4868 to 9719905 Compare August 4, 2023 03:17
@tgross35 tgross35 changed the title (Do not merge) Perf test for Rc & Arc Allocator (#89132) Improve performance of Rc & Arc Aug 4, 2023
@tgross35 tgross35 force-pushed the rc-allocator-support-perftests branch from ff60310 to 9719905 Compare August 4, 2023 03:57
Some preliminary testing indicated that there are potential gains to be
made with `Rc` and `Arc`. Add `#[inline]`s to help improve performance.
Add some line breaks where they were missing between blocks.
@tgross35 tgross35 force-pushed the rc-allocator-support-perftests branch from 9719905 to 864445b Compare August 4, 2023 03:59
@tgross35
Copy link
Contributor Author

tgross35 commented Aug 4, 2023

Okay, I cleaned this up so it should be mergable, so I'll mark it ready for review.

The changes here should be about the same as what produced the perf results above. The performance wins are fairly significant, but the binary size increases are also notable. I'll leave it up to the reviewer what the call is on this.

This may merit a perf rerun since the base changed significantly (the above run included adding the allocator API changes, since then the Arc Allocator API has been merged).

See also #114446 where I'm trying to figure out some inlining things for the layout calculation (but I will keep that PR separate from this one since that one touches more things)

cc @TimDiekmann, this is the followup to adding the allocator API
@rustbot ready

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 4, 2023
@tgross35 tgross35 marked this pull request as ready for review August 4, 2023 04:13
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 4, 2023
@tgross35 tgross35 changed the title Improve performance of Rc & Arc Small performance gains for Rc & Arc Aug 4, 2023
@tgross35 tgross35 changed the title Small performance gains for Rc & Arc Small performance wins for Rc & Arc Aug 4, 2023
@Mark-Simulacrum
Copy link
Member

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Aug 6, 2023

⌛ Trying commit 864445b with merge 0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f...

@bors
Copy link
Contributor

bors commented Aug 6, 2023

☀️ Try build successful - checks-actions
Build commit: 0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f (0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f)

1 similar comment
@bors
Copy link
Contributor

bors commented Aug 6, 2023

☀️ Try build successful - checks-actions
Build commit: 0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f (0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f)

@tgross35
Copy link
Contributor Author

tgross35 commented Aug 7, 2023

It looks like perf maybe didn’t get queued, could you retry @Mark-Simulacrum?

@Kobzol
Copy link
Contributor

Kobzol commented Aug 7, 2023

@rust-timer build 0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0ef074b4e9cbe42f2c6a4e5f3c529e371fdae41f): 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)
1.2% [1.1%, 1.2%] 2
Regressions ❌
(secondary)
1.2% [0.5%, 1.4%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-2.1%, -0.3%] 6
All ❌✅ (primary) 1.2% [1.1%, 1.2%] 2

Max RSS (memory usage)

Results

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)
4.5% [1.3%, 7.0%] 3
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-7.2% [-7.2%, -7.2%] 1
Improvements ✅
(secondary)
-2.4% [-2.9%, -1.9%] 2
All ❌✅ (primary) 1.6% [-7.2%, 7.0%] 4

Cycles

Results

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)
4.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.2%, -1.7%] 2
All ❌✅ (primary) - - 0

Binary size

Results

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.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.6%, -0.0%] 7
Improvements ✅
(secondary)
-2.8% [-3.3%, -1.4%] 4
All ❌✅ (primary) -0.1% [-0.6%, 0.0%] 8

Bootstrap: 651.433s -> 652.417s (0.15%)

@tgross35
Copy link
Contributor Author

tgross35 commented Aug 7, 2023

Thanks @Kobzol

Well, this time around the results seem a lot more like noise

@Mark-Simulacrum
Copy link
Member

I think this isn't worth it given the largely noise results here. Thanks for trying it!

@tgross35 tgross35 deleted the rc-allocator-support-perftests branch July 16, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library 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