Skip to content

derive(PartialEq) via bitwise comparison where possible - #149253

Draft
saethlin wants to merge 2 commits into
rust-lang:mainfrom
saethlin:can-compare-bitwise
Draft

saethlin wants to merge 2 commits into
rust-lang:mainfrom
saethlin:can-compare-bitwise

Conversation

@saethlin

Copy link
Copy Markdown
Member

No description provided.

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 24, 2025
@saethlin saethlin linked an issue Nov 24, 2025 that may be closed by this pull request
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@saethlin

This comment was marked as outdated.

@saethlin
saethlin force-pushed the can-compare-bitwise branch 2 times, most recently from b85bc2a to 691bbf7 Compare November 24, 2025 05:01
@saethlin

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Nov 24, 2025
derive(PartialEq) via bitwise comparison where possible
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 24, 2025
@rust-bors

rust-bors Bot commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4ca5d88 (4ca5d8859eb246cbe04c84e29d4429f61cd2165e, parent: 42ec52babac2cbf2bb2b9d794f980cbcb3ebe413)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4ca5d88): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
1.1% [0.3%, 1.4%] 10
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 16
Improvements ✅
(secondary)
-0.4% [-1.3%, -0.1%] 6
All ❌✅ (primary) -0.3% [-0.5%, 0.2%] 19

Max RSS (memory usage)

Results (primary 2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Cycles

Results (secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 1

Bootstrap: 471.257s -> 470.709s (-0.12%)
Artifact size: 388.26 MiB -> 388.27 MiB (0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 24, 2025
@saethlin

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Nov 30, 2025
derive(PartialEq) via bitwise comparison where possible
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 30, 2025
@rust-bors

rust-bors Bot commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: e44f742 (e44f742bf18fd0d12074d5616b865b3b06408b46, parent: f40a70d2bcd830a4f1f8c7ca1a7f93f1d9d703d6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e44f742): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.2%] 3
Regressions ❌
(secondary)
1.0% [0.2%, 1.3%] 11
Improvements ✅
(primary)
-0.3% [-0.6%, -0.1%] 21
Improvements ✅
(secondary)
-0.2% [-1.2%, -0.1%] 40
All ❌✅ (primary) -0.3% [-0.6%, 0.2%] 24

Max RSS (memory usage)

Results (secondary 1.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Binary size

Results (secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 469.915s -> 474.851s (1.05%)
Artifact size: 386.98 MiB -> 386.96 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 1, 2025
@saethlin

saethlin commented Dec 6, 2025

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Dec 6, 2025
derive(PartialEq) via bitwise comparison where possible
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 6, 2025
@rust-bors

rust-bors Bot commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: b5d9019 (b5d90197198f0cf8d1d63e6c89d591cdc0fee505, parent: da2544bfbe84df7b24d83c029c74299ebf6112c6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (b5d9019): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.2%] 3
Regressions ❌
(secondary)
1.1% [0.3%, 1.4%] 10
Improvements ✅
(primary)
-0.3% [-0.6%, -0.1%] 25
Improvements ✅
(secondary)
-0.3% [-1.2%, -0.0%] 32
All ❌✅ (primary) -0.2% [-0.6%, 0.2%] 28

Max RSS (memory usage)

Results (primary 6.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
6.8% [6.8%, 6.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.8% [6.8%, 6.8%] 1

Cycles

Results (secondary 3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% [2.4%, 5.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.2%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 0.3%] 2
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 7
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.0%, 0.3%] 3

Bootstrap: 471.557s -> 469.215s (-0.50%)
Artifact size: 388.95 MiB -> 388.87 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 6, 2025
@saethlin

saethlin commented Dec 7, 2025

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Dec 7, 2025
derive(PartialEq) via bitwise comparison where possible
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 7, 2025
@rust-bors

rust-bors Bot commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3c3569a (3c3569a7a0d01d4956cb13b0c8985f54c24ab633, parent: ba86c0460b0233319e01fd789a42a7276eade805)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3c3569a): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.4%] 3
Regressions ❌
(secondary)
1.4% [0.2%, 2.9%] 16
Improvements ✅
(primary)
-0.3% [-0.6%, -0.1%] 18
Improvements ✅
(secondary)
-0.3% [-1.2%, -0.1%] 27
All ❌✅ (primary) -0.2% [-0.6%, 0.4%] 21

Max RSS (memory usage)

Results (primary 1.6%, secondary 2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.8% [3.8%, 3.8%] 1
Regressions ❌
(secondary)
2.3% [1.6%, 3.6%] 4
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [-0.6%, 3.8%] 2

Cycles

Results (secondary 1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.8% [3.8%, 8.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.2%, -2.3%] 3
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.2%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 0.5%] 3
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.0%, 0.5%] 3

Bootstrap: 470.7s -> 471.689s (0.21%)
Artifact size: 388.87 MiB -> 388.87 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 7, 2025
@saethlin
saethlin force-pushed the can-compare-bitwise branch from f67692a to c49757c Compare December 7, 2025 22:37
@saethlin

saethlin commented Dec 7, 2025

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Dec 7, 2025
derive(PartialEq) via bitwise comparison where possible
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 7, 2025
@rust-bors

rust-bors Bot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9dfaa96 (9dfaa96c7c0cfbd82e36663fa4b5796df7628d89, parent: ba2142a19c1acabe770433418fa395b8a0ef47a4)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9dfaa96): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.1%, 1.0%] 62
Regressions ❌
(secondary)
0.9% [0.0%, 32.4%] 69
Improvements ✅
(primary)
-0.4% [-0.4%, -0.3%] 6
Improvements ✅
(secondary)
-0.9% [-2.7%, -0.1%] 24
All ❌✅ (primary) 0.3% [-0.4%, 1.0%] 68

Max RSS (memory usage)

Results (primary -1.6%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [1.4%, 2.2%] 2
Improvements ✅
(primary)
-1.6% [-2.5%, -0.7%] 2
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) -1.6% [-2.5%, -0.7%] 2

Cycles

Results (primary 4.2%, secondary 14.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.2% [2.2%, 14.7%] 32
Regressions ❌
(secondary)
14.6% [2.1%, 365.7%] 35
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.2% [2.2%, 14.7%] 32

Binary size

Results (primary -0.4%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 7
Improvements ✅
(primary)
-0.5% [-1.0%, -0.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-1.0%, 0.0%] 3

Bootstrap: 470.113s -> 470.64s (0.11%)
Artifact size: 388.98 MiB -> 389.07 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 8, 2025
@rust-bors

rust-bors Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #151490) made this pull request unmergeable. Please resolve the merge conflicts.

This branch has not been deployed

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

Bad codegen for comparing struct of two 16bit ints

4 participants