Skip to content

Commit 36cb75d

Browse files
authored
bench: size the decimal kernel benchmarks by bytes rather than rows (#9980)
## Summary The decimal kernel benchmarks landed with a 1,024 row case. For `i128` that runs in 0.4 to 1.2 µs on the walltime legs, below what those machines resolve, so it reports mostly jitter: it moved by 10 to 19% on ten of the last thirteen CodSpeed reports, every one of them on a pull request that touched no decimal code. No 8,192 row case and no `i256` case has moved in those reports. ## Changes Derive each kernel case's row count from a working set of 256 KiB and 1 MiB of input plus output, rather than fixing it at 1,024 and 8,192 rows: | Decimal width | Small case | Large case | | --- | ---: | ---: | | `i128` | 8,192 rows | 32,768 rows | | `i256` | 4,096 rows | 16,384 rows | Both widths now do comparable work, every case takes several microseconds instead of fractions of one, and the largest still fits the 1 MiB L2 cache of the Graviton leg, so these stay measurements of kernel code rather than of memory bandwidth. The array benchmarks in the same files are `#[cfg(not(codspeed))]` and never run in CI, so they keep their sizes for quick local runs. The benchmarking guide gains the measured walltime floor next to the simulation floor documented in #9951. Expect a one-time batch of CodSpeed rows for these eight cases when this merges, since the inputs change size. Checked with `cargo clippy -p vortex-decimal-byte-parts --all-targets --all-features -- -D warnings` and `cargo fmt`. No benchmarks were run locally: this session is a shared cloud VM, so its walltime numbers would not mean anything. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01B6ApyxEXpjiasZbQptsypn --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Signed-off-by: Connor Tsui <[email protected]>
1 parent 36b1f86 commit 36cb75d

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • encodings/decimal-byte-parts/benches/common

‎encodings/decimal-byte-parts/benches/common/mod.rs‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,24 @@ use vortex_array::dtype::DecimalType;
1010
use vortex_array::dtype::i256;
1111
use vortex_buffer::Buffer;
1212

13+
/// Decimal widths under test, with the input plus output bytes each row moves.
14+
///
15+
/// Splitting reads one decimal and writes a most significant part plus lower parts of the same
16+
/// total width, and assembly does the reverse, so both move twice the decimal's size per row.
17+
const WIDTHS: [(DecimalType, usize); 2] = [
18+
(DecimalType::I128, 2 * size_of::<i128>()),
19+
(DecimalType::I256, 2 * size_of::<i256>()),
20+
];
21+
22+
/// Working set per kernel iteration.
23+
const WORKING_SET_BYTES: [usize; 2] = [256 * 1024, 1024 * 1024];
24+
1325
pub(super) fn cases() -> Vec<(DecimalType, usize)> {
14-
[DecimalType::I128, DecimalType::I256]
26+
WIDTHS
1527
.into_iter()
16-
.flat_map(|values_type| [1_024, 8_192].map(|len| (values_type, len)))
28+
.flat_map(|(values_type, bytes_per_row)| {
29+
WORKING_SET_BYTES.map(|bytes| (values_type, bytes / bytes_per_row))
30+
})
1731
.collect()
1832
}
1933

0 commit comments

Comments
 (0)