Skip to content

chore[array]: add filter bool bench#7122

Open
joseph-isaacs wants to merge 3 commits intodevelopfrom
ji/bool-filter-bench
Open

chore[array]: add filter bool bench#7122
joseph-isaacs wants to merge 3 commits intodevelopfrom
ji/bool-filter-bench

Conversation

@joseph-isaacs
Copy link
Contributor

Add filter bool benchmarks to later optimize

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2026

Merging this PR will not alter performance

✅ 1016 untouched benchmarks
🆕 109 new benchmarks
⏩ 1522 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation density_sweep_dense_runs[0.001] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.02] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.005] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.5] N/A 1.4 ms N/A
🆕 Simulation density_sweep_dense_runs[0.05] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.95] N/A 2.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.1] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.9999] N/A 328.5 µs N/A
🆕 Simulation density_sweep_dense_runs[0.999] N/A 342.2 µs N/A
🆕 Simulation density_sweep_dense_runs[0.01] N/A 1.1 ms N/A
🆕 Simulation density_sweep_dense_runs[0.99] N/A 636.9 µs N/A
🆕 Simulation density_sweep_dense_runs[0.9] N/A 3.7 ms N/A
🆕 Simulation density_sweep_random[0.001] N/A 35.9 µs N/A
🆕 Simulation density_sweep_random[0.005] N/A 50.4 µs N/A
🆕 Simulation density_sweep_random[0.01] N/A 64.1 µs N/A
🆕 Simulation density_sweep_random[0.99] N/A 655.9 µs N/A
🆕 Simulation density_sweep_random[0.02] N/A 90.6 µs N/A
🆕 Simulation density_sweep_random[0.05] N/A 171 µs N/A
🆕 Simulation density_sweep_random[0.95] N/A 2 ms N/A
🆕 Simulation density_sweep_random[0.9999] N/A 320.3 µs N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing ji/bool-filter-bench (f0ed8c4) with develop (cbc8ad1)

Open in CodSpeed

Footnotes

  1. 1522 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@joseph-isaacs joseph-isaacs added the changelog/skip Do not list PR in the changelog label Mar 23, 2026
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs marked this pull request as ready for review March 23, 2026 10:52
u
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs enabled auto-merge (squash) March 23, 2026 11:59
@joseph-isaacs joseph-isaacs requested a review from 0ax1 March 23, 2026 12:02
fn head_to_head_old(bencher: Bencher, density: f64) {
let mut rng = StdRng::seed_from_u64(ARRAY_SEED);
let src = BitBuffer::from_iter((0..DENSITY_SWEEP_SIZE).map(|_| rng.random_bool(0.5)));
let true_count = make_density_mask(DENSITY_SWEEP_SIZE, density, &mut mask_rng()).true_count();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not compute both in with inputs rather than calc true count upfront?

let true_count = make_density_mask(DENSITY_SWEEP_SIZE, density, &mut mask_rng()).true_count()


#[divan::bench(args = LARGE_SIZES)]
fn filter_ultra_sparse(bencher: Bencher, n: usize) {
let array = make_random_bool_array(n, &mut StdRng::seed_from_u64(ARRAY_SEED));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we black box all bench inputs here, and elsewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/skip Do not list PR in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants