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

Implement internal IsZero for Wrapping and Saturating for Vec optimizations #93455

Merged
merged 1 commit into from
Sep 4, 2022

Conversation

asquared31415
Copy link
Contributor

@asquared31415 asquared31415 commented Jan 29, 2022

This implements the IsZero trait for the Wrapping and Saturating types so that users of these types can get the improved performance from the specialization of creating a Vec from a single element repeated when it has a zero bit pattern (example vec![0_i32; 500], or after this PR vec![Wrapping(0_i32); 500])

CC #60978

@rust-highfive
Copy link
Collaborator

r? @kennytm

(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 Jan 29, 2022
@rust-log-analyzer

This comment has been minimized.

@asquared31415
Copy link
Contributor Author

I think this is a spurious CI failure

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2022
@Dylan-DPC
Copy link
Member

r? @m-ou-se

@rust-highfive rust-highfive assigned m-ou-se and unassigned kennytm Apr 11, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2022
@apiraino apiraino added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 19, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2022
@thomcc
Copy link
Member

thomcc commented Aug 26, 2022

r? @thomcc

@rust-highfive rust-highfive assigned thomcc and unassigned m-ou-se Aug 26, 2022
@thomcc
Copy link
Member

thomcc commented Aug 26, 2022

This is fully internal and looks good to me. No rollup since this could help perf a fair bit in the off-chance we have uses of this inside rustc (this is pretty unlikely, though).

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Aug 26, 2022

📌 Commit 652c3fc811d977f620323cb7d8e63136d6b0207a has been approved by thomcc

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 Aug 26, 2022
@bors
Copy link
Contributor

bors commented Aug 26, 2022

⌛ Testing commit 652c3fc811d977f620323cb7d8e63136d6b0207a with merge efb31449a452d93ed96b2c293a895b52ee257bfe...

@bors
Copy link
Contributor

bors commented Aug 26, 2022

💔 Test failed - checks-actions

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 26, 2022
@thomcc
Copy link
Member

thomcc commented Aug 26, 2022

Oh, hm, this needs more specialization...

@thomcc
Copy link
Member

thomcc commented Aug 26, 2022

I'd like to rereview after you make whatever changes are needed, so don't just carry the r+ forward if you don't mind.

@thomcc
Copy link
Member

thomcc commented Aug 26, 2022

Ah, apparently I have to do this to remove it from the queue.

@bors r-

@rust-log-analyzer

This comment has been minimized.

@asquared31415
Copy link
Contributor Author

I did not mean to close this, whoops

@asquared31415 asquared31415 reopened this Sep 2, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@asquared31415
Copy link
Contributor Author

@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 Sep 3, 2022
@thomcc
Copy link
Member

thomcc commented Sep 4, 2022

LGTM (and cleaner now), thanks.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 4, 2022

📌 Commit 80e035c has been approved by thomcc

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

bors commented Sep 4, 2022

⌛ Testing commit 80e035c with merge 289279d...

@bors
Copy link
Contributor

bors commented Sep 4, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 289279d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 4, 2022
@bors bors merged commit 289279d into rust-lang:master Sep 4, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 4, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (289279d): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.6%, 1.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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.

mean1 range count2
Regressions ❌
(primary)
2.0% [1.7%, 2.8%] 8
Regressions ❌
(secondary)
2.5% [2.5%, 2.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [1.7%, 2.8%] 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.

mean1 range count2
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

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-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.