Skip to content

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Oct 12, 2025

It's a big speed win for cranelift-codegen-0.119.0.

r? @Zalathar

@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. labels Oct 12, 2025
@nnethercote
Copy link
Contributor 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 Oct 13, 2025
Add a `!=` check to `ChunkedBitSet::union`.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 13, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 13, 2025

☀️ Try build successful (CI)
Build commit: 701ca72 (701ca7229fdda54e3b2aaf5d347786d78565ec43, parent: 2300c2aef7dbc2a7bbbeaa9894d07d459abd9bc6)

@rust-timer

This comment has been minimized.

@Zalathar
Copy link
Contributor

For future work, we could hypothetically get even more clever, and try to start the bitwise_changes check from where the equality check failed (for suitable operators).

But that might not be worth the extra implementation complexity (or might even reduce the benefit of the equality check).

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (701ca72): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.7% [-9.6%, -1.3%] 6
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -4.7% [-9.6%, -1.3%] 6

Max RSS (memory usage)

Results (primary 2.0%)

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

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

Cycles

Results (primary -3.3%, secondary 2.7%)

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

Binary size

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

Bootstrap: 472.507s -> 474.412s (0.40%)
Artifact size: 388.12 MiB -> 388.13 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 13, 2025
@nnethercote
Copy link
Contributor Author

For future work, we could hypothetically get even more clever, and try to start the bitwise_changes check from where the equality check failed (for suitable operators).

But that might not be worth the extra implementation complexity (or might even reduce the benefit of the equality check).

Interesting idea! I tried it out, with code like this:

                    let i = match iter::zip(
                        &self_chunk_words[0..num_words],
                        &other_chunk_words[0..num_words],
                    )
                    .position(|(a, b)| a != b)
                    {
                        Some(i) => i,
                        None => continue, // all elements equal, nothing more to do
                    };

                    let op = |a, b| a | b;
                    if !bitwise_changes(
                        &self_chunk_words[i..num_words],
                        &other_chunk_words[i..num_words],
                        op,
                    ) {
                        continue;
                    }
                    
                    // ... do the mutation ...

And it ended up being a significant slowdown. I think because that iter::zip/position loop is much less optimized than simple slice comparison, which would use something like memcmp.

@nnethercote
Copy link
Contributor Author

I have update the code a little to include some refactoring.

@nnethercote nnethercote marked this pull request as ready for review October 13, 2025 09:16
@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 Oct 13, 2025
@Zalathar
Copy link
Contributor

Looks good, thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 13, 2025

📌 Commit ad8b2e0 has been approved by Zalathar

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 Oct 13, 2025
@nnethercote nnethercote mentioned this pull request Oct 13, 2025
@rust-log-analyzer

This comment has been minimized.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
…illot,Zalathar

Bitset cleanups

Some minor cleanups I did while working on rust-lang#147619.

r? `@Zalathar`
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Oct 14, 2025
…illot,Zalathar

Bitset cleanups

Some minor cleanups I did while working on rust-lang#147619.

r? `@Zalathar`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
…illot,Zalathar

Bitset cleanups

Some minor cleanups I did while working on rust-lang#147619.

r? ``@Zalathar``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2025
…illot,Zalathar

Bitset cleanups

Some minor cleanups I did while working on rust-lang#147619.

r? ```@Zalathar```
rust-timer added a commit that referenced this pull request Oct 15, 2025
Rollup merge of #147630 - nnethercote:bitset-cleanups, r=cjgillot,Zalathar

Bitset cleanups

Some minor cleanups I did while working on #147619.

r? ```@Zalathar```
@bors
Copy link
Collaborator

bors commented Oct 15, 2025

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

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 15, 2025
@rustbot

This comment has been minimized.

@Zalathar
Copy link
Contributor

(I pushed a rebase to fix the merge conflicts; just double-checking my own work before I reapprove.)

@rust-log-analyzer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

nnethercote commented Oct 15, 2025

Uh, so what's happening? I'm generally capable of managing my own PRs. Have you taken this over now? Can I do anything with it or will that mess things up?

@rustbot

This comment has been minimized.

@Zalathar
Copy link
Contributor

Ah, I was thinking it would be helpful to rebase this, but maybe I ended up causing more confusion.

I've force-pushed back to your original commit, and I won't touch this any more, so please feel free to resolve it yourself and reapprove.

@nnethercote
Copy link
Contributor Author

Ok, thanks.

For less indentation, mostly.
It's a big speed win for cranelift-codegen-0.119.0.
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nnethercote
Copy link
Contributor Author

I have rebased.

@bors r=Zalathar

@bors
Copy link
Collaborator

bors commented Oct 15, 2025

📌 Commit 6048182 has been approved by Zalathar

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 15, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 15, 2025
…athar

Bitset cleanups

Some minor cleanups I did while working on rust-lang/rust#147619.

r? ```@Zalathar```
@bors
Copy link
Collaborator

bors commented Oct 15, 2025

⌛ Testing commit 6048182 with merge 4f08307...

@bors
Copy link
Collaborator

bors commented Oct 15, 2025

☀️ Test successful - checks-actions
Approved by: Zalathar
Pushing 4f08307 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 15, 2025
@bors bors merged commit 4f08307 into rust-lang:master Oct 15, 2025
12 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 15, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 5413f7d (parent) -> 4f08307 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4f08307f6efdbca86d27beecd257fad9913192e9 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-mingw: 8717.0s -> 10591.0s (21.5%)
  2. dist-x86_64-apple: 6952.6s -> 8058.0s (15.9%)
  3. dist-apple-various: 3943.6s -> 4517.6s (14.6%)
  4. dist-i686-mingw: 9549.0s -> 10751.7s (12.6%)
  5. x86_64-mingw-2: 7527.0s -> 8388.0s (11.4%)
  6. pr-check-1: 1517.4s -> 1657.6s (9.2%)
  7. x86_64-gnu-llvm-20: 2673.5s -> 2435.8s (-8.9%)
  8. x86_64-mingw-1: 10391.2s -> 11265.4s (8.4%)
  9. dist-ohos-aarch64: 4323.0s -> 4664.4s (7.9%)
  10. x86_64-gnu-tools: 3392.1s -> 3650.3s (7.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

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

6 participants