Skip to content

Conversation

@quaternic
Copy link
Contributor

Feature gate: #![feature(uint_gather_scatter_bits)]
Tracking issue: #149069
Accepted ACP: rust-lang/libs-team#695 (comment)

For each method, there are three benchmarks, which differ in that the mask (second) argument is one of:

  • constant at compile time
  • runtime value but invariant for the measured loop
  • different for each call

Sample output

    num::int_bits::u32::constant::gather_bits      555.82ns/iter   +/- 22.41
    num::int_bits::u32::constant::scatter_bits     545.45ns/iter  +/- 124.26
    num::int_bits::u32::invariant::gather_bits    8178.86ns/iter  +/- 217.37
    num::int_bits::u32::invariant::scatter_bits   7135.95ns/iter  +/- 214.51
    num::int_bits::u32::variable::gather_bits    10539.29ns/iter  +/- 198.90
    num::int_bits::u32::variable::scatter_bits    9671.26ns/iter  +/- 254.88

(and similarly for the other uN types)

@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 Dec 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 4, 2025

📌 Commit 7e7d724 has been approved by Mark-Simulacrum

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 Dec 4, 2025
bors added a commit that referenced this pull request Dec 4, 2025
Rollup of 10 pull requests

Successful merges:

 - #149521 (Improve `io::Error::downcast`)
 - #149544 (Only apply `no_mangle_const_items`'s suggestion to plain const items)
 - #149545 (fix the check for which expressions read never type)
 - #149570 (rename cortex-ar references to unified aarch32)
 - #149574 (Batched compiletest Config fixups)
 - #149579 (Motor OS: fix compile error)
 - #149595 (Tidying up `tests/ui/issues` tests [2/N])
 - #149597 (Revert "implement and test `Iterator::{exactly_one, collect_array}`")
 - #149608 (Allow PowerPC spe_acc as clobber-only register)
 - #149610 (Implement benchmarks for uN::{gather,scatter}_bits)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ac607e0 into rust-lang:main Dec 4, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Dec 4, 2025
Rollup merge of #149610 - quaternic:gather-scatter-bits-bench, r=Mark-Simulacrum

Implement benchmarks for uN::{gather,scatter}_bits

Feature gate: #![feature(uint_gather_scatter_bits)]
Tracking issue: #149069
Accepted ACP: rust-lang/libs-team#695 (comment)

For each method, there are three benchmarks, which differ in that the mask (second) argument is one of:
 - constant at compile time
 - runtime value but invariant for the measured loop
 - different for each call

Sample output
```text
    num::int_bits::u32::constant::gather_bits      555.82ns/iter   +/- 22.41
    num::int_bits::u32::constant::scatter_bits     545.45ns/iter  +/- 124.26
    num::int_bits::u32::invariant::gather_bits    8178.86ns/iter  +/- 217.37
    num::int_bits::u32::invariant::scatter_bits   7135.95ns/iter  +/- 214.51
    num::int_bits::u32::variable::gather_bits    10539.29ns/iter  +/- 198.90
    num::int_bits::u32::variable::scatter_bits    9671.26ns/iter  +/- 254.88
```
(and similarly for the other `uN` types)
@rustbot rustbot added this to the 1.93.0 milestone Dec 4, 2025
@quaternic quaternic deleted the gather-scatter-bits-bench branch December 4, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants