Skip to content

codspeed: make benchmark measure less noise - #10855

Merged
robert3005 merged 1 commit into
developfrom
myrrc/better-codspeed-benches
Oct 27, 2026
Merged

robert3005 merged 1 commit into
developfrom
myrrc/better-codspeed-benches

Conversation

@myrrc

@myrrc myrrc commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

This PR changes Codspeed benchmarks to measure more useful work and not noise.

  1. take_union: array size 100k -> 10k. Creating 100k rows with format!()
    dominates runtime.
  2. bench_for_compress_i32: create new array for every iteration. FoR reads Min
    from cache from second iteration if we don't do this.
  3. bench_alp_rd_compress_f64: move out RDEncoder training out of iteration.
  4. python test_scan_scalar_at: move out array creation from benchmark
  5. slice_bounds: remove runs for 4096 elements as they're too small and noisy.
  6. rank: remove runs for 1024 elements as they're too small and noisy.
  7. bloom_filter: remove run for 1048576 elements as this dominates runtime (32mb
    insert for every iteration is not a microbenchmark).
  8. alp_ compress: use more random values so that ALP dictionary doesn't contain
    all of them.
  9. fastlanes bitpack_compare: remove all specialisations but 64 * 1024 elements
    and bit width 16. Output is ConstantArray so specializations don't differ.
  10. fastlanes bitpack_compare_sweep: 64 fastlanes blocks -> 8 block. 64 blocks
    dominate shard time.
  11. fastlanes bitpacking_filter: remove selected_per_chunk = 8 as it's too fast
    for stable measure. Move mask clone out of iteration.
  12. fastlanes bitpacking_take: remove selected_per_chunk = 8. Lower rows from
    4096 to 512 values (dominates run time for small take sizes). Remove
    assert_array_eq, benchmark shouldn't measure correctness. Make isolated_runs
    matrix smaller.
  13. fastlanes canonicalize_bench: measure benchmarks in codspeed, lower size to
    1000 elements from 10000.
  14. fastlanes cast_bitpacked: remove non-existent canonicalize_then_cast doc.
  15. fsst_take: remove canonicalization and array_assert_eq, benchmark should not
    measure correctness. Lower 64 test cases to 24.
  16. run_end_null_count: run fixture on every iteration. NullCount is cached,
    array measures cache read otherwise.
  17. run_end_sum: increase length from 2048 to 65536, on small values kernel
    dispatch dominates the runtime
  18. run_end_take: increase take length from 2048 to 4096 and 8192 to measure
    array_length <= take * 8 special case.
  19. sparse_compare: move make_sparse creation from input preparation. Execute
    until Sparse instead of canonicalizing.
  20. lt_i64_nullable: use I64_LEN instead of LEN so that walltime checks use same
    265kb of data and are less noisy.
  21. cast_i32_to_u32: build PrimitiveArray on every iteration. Min/Max was cached
    on first scan and subsequent iterations measures stats cached value read.
  22. chunked_dict_builder: lower tested cases from 48 to 12.
  23. chunked_fsl_canonicalize: lower lists per chunk from 1000 to 128, remove
    1024 list size case as counting allocations dominates the runtime.
  24. compare_sorted: remove non-implemented sorted fast path code.
  25. dict_compare: remove 42 nearly identical cases. Dict decode still dominates
    the runtime.
  26. dict_compress: remove extra length arguments from benchmark. Dict
    compression doesn't significantly depend on dict length but rather on values
    length.
  27. dict_unreferences_mask: don't reference last value so scan does indeed cover
    every code.
  28. case_when_fragmented: increase sizes from 100 and 400 to 4096 and 16384 as
    expression dispatch dominates runtime with small sizes.
  29. density_sweep_single_slice: remove 12 density cases. Every sweep is an O(1)
    slice.
  30. filter_all_true: remove all cases but one. Every AllTrue slice is a child
    clone which is independent of input size.
  31. filter_ultra_sparse: remove 100000 elements case in which mask reduces to a
    slice case.
  32. kleene_bool: remove benchmarks which measure same thing as _aligned
    benchmarks.
  33. take_chunked: remove single-element take as it's too fast.
  34. take_filter: create a FilterArray instead of filtering a PrimitiveArray as
    .filter() calls .optimize() and filter is transformed to a slice.
  35. stats calc: use a deterministic seed every time.
  36. bench_stats: create a new array per iteration as it's done for integer
    stats.
  37. btrblocks compress: create a new array per iteration, same as (36)
  38. btrblocks compress_listview: clear statistics per iteration to avoid reading
    cached stats.
  39. buffer, bitbuffer: return computed values from bench so it's not optimized
    out. Lower checked cases size, remove small cases which are noisy.
  40. intersect_by_rank: create a new mask per iteration so every iteration uses
    fresh indices.
  41. runend_cuda: add StandaloneOnly dispatch mode as it's done for ALP
    benchmark.
  42. zstd_cuda: use 10m rows instead of 100m as done for FSST and OnPair.

Non-benchmark changes:

  • haystack, dict builder: use a deterministic hasher instead of a fully random one.
    Primitive builder already uses it.

@myrrc
myrrc requested a review from robert3005 October 27, 2026 12:49
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@myrrc
myrrc force-pushed the myrrc/better-codspeed-benches branch from e927670 to 344ee12 Compare October 27, 2026 13:38
@codspeed

codspeed Bot commented Oct 27, 2026

Copy link
Copy Markdown

Merging this PR will regress 35 benchmarks

3 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 259 improved benchmarks
❌ 35 regressed benchmarks
✅ 1895 untouched benchmarks
🆕 19 new benchmarks
⏩ 366 skipped benchmarks1
🗄️ 73 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation bench_many_codes_few_values[1024] 42.8 µs 517 µs -91.73%
❌ CPU Simulation bench_many_codes_few_values[2048] 93.7 µs 516.2 µs -81.84%
❌ Walltime lt_i64_nullable_neon 2.9 µs 10.5 µs -72.07%
❌ Walltime lt_i64_nullable_avx2 2.5 µs 8.3 µs -69.92%
❌ Walltime lt_i64_nullable_avx512 2.5 µs 8 µs -69.22%
❌ CPU Simulation bench_many_codes_few_values[4096] 257.3 µs 523.6 µs -50.86%
❌ CPU Simulation whole_array_sum_partially_valid 77.8 µs 114.5 µs -32.05%
❌ CPU Simulation bitwise_and_arrow_buffer[2048] 3.8 µs 5.4 µs -29%
❌ CPU Simulation decompress_rd[f32, (10000, 0.1)] 185.2 µs 249.8 µs -25.86%
❌ CPU Simulation decompress_rd[f32, (2000, 0.1)] 81.6 µs 108.2 µs -24.58%
❌ CPU Simulation bench_compare_varbin[(50000, 2)] 126.1 µs 166 µs -23.99%
❌ CPU Simulation uneven_take[(1, 1024, Short)] 84.7 µs 109.2 µs -22.44%
❌ CPU Simulation compress_rd[f32, (2000, 0.1)] 137.8 µs 177.3 µs -22.28%
❌ CPU Simulation decompress_rd[f32, (2000, 0.01)] 81.6 µs 104.5 µs -21.92%
❌ CPU Simulation compress_rd[f32, (2000, 0.01)] 137.4 µs 175 µs -21.47%
❌ CPU Simulation decompress_rd[f32, (10000, 0.01)] 185.4 µs 234.6 µs -20.95%
❌ CPU Simulation isolated_runs[u8, (161, 0)] 64.3 µs 81.2 µs -20.81%
❌ CPU Simulation take_filter_primitive_slice_mask_random_indices[4096, 1000] 63.6 µs 78.7 µs -19.26%
❌ CPU Simulation compress_rd[f64, (2000, 0.1)] 166.8 µs 202 µs -17.43%
❌ CPU Simulation decompress_rd[f64, (10000, 0.1)] 277.2 µs 335.4 µs -17.36%
... ... ... ... ... ...

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

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing myrrc/better-codspeed-benches (344ee12) with develop (cf2fb6b)

Open in CodSpeed

Footnotes

  1. 366 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. ↩

  2. 73 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them. ↩

@robert3005
robert3005 merged commit a5f574e into develop Oct 27, 2026
112 of 114 checks passed
@robert3005
robert3005 deleted the myrrc/better-codspeed-benches branch October 27, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants