Skip to content

bench(engine): SpillPolicy compression/granularity perf (#2349) - #4382

Merged
oferchen merged 2 commits into
masterfrom
bench/spill-policy-perf
May 18, 2026
Merged

oferchen merged 2 commits into
masterfrom
bench/spill-policy-perf

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds crates/engine/benches/spill_policy_perf.rs, a criterion bench that sweeps the four SpillPolicy cells - compression (None vs Zstd { level: 3 }) crossed with granularity (WholeBatch vs PerItem) - over a forced-spill workload of 1000 mixed DeltaResult payloads.
  • Each cell runs a hand-rolled simulation that encodes via DeltaResult's SpillCodec, optionally zstd-compresses, and writes to an in-memory Cursor; the bench prints simulated bytes-on-disk alongside the criterion wall-clock so the space/time tradeoff is visible per cell.
  • A real_buffer/baseline arm drives the same workload through a live SpillableReorderBuffer::new(256, 16 KiB) so the simulated cells can be read relative to the production code path (current default: WholeBatch + None).
  • Bench is #![cfg(unix)], registered with required-features = ["spill-compression"], and pulls in zstd = "0.13" as a unix-only dev dependency so default builds remain unchanged.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
  • cargo bench -p engine --features spill-compression --bench spill_policy_perf -- --quick on a unix host
  • Confirm the per-cell bytes_on_disk log line is emitted for all four cells before the criterion samples

@oferchen
oferchen force-pushed the bench/spill-policy-perf branch from fab24a7 to ff3426f Compare May 18, 2026 00:12
oferchen added 2 commits May 18, 2026 03:57
Add a criterion benchmark that sweeps the four SpillPolicy cells
(compression None vs Zstd-3, granularity WholeBatch vs PerItem)
against a forced-spill workload of 1000 mixed DeltaResult payloads,
plus a real SpillableReorderBuffer baseline with a 16 KiB threshold.

Each cell prints its simulated bytes-on-disk alongside the criterion
timing so default tuning has a side-by-side wall-clock + space view.
The bench is cfg(unix) and gated behind the existing spill-compression
feature, so default builds stay free of the zstd dev dependency.
@oferchen
oferchen force-pushed the bench/spill-policy-perf branch from ff3426f to b812daa Compare May 18, 2026 00:57
@oferchen
oferchen merged commit c4abd65 into master May 18, 2026
5 of 16 checks passed
oferchen added a commit that referenced this pull request May 18, 2026
* bench(engine): SpillPolicy compression/granularity perf (#2349)

Add a criterion benchmark that sweeps the four SpillPolicy cells
(compression None vs Zstd-3, granularity WholeBatch vs PerItem)
against a forced-spill workload of 1000 mixed DeltaResult payloads,
plus a real SpillableReorderBuffer baseline with a 16 KiB threshold.

Each cell prints its simulated bytes-on-disk alongside the criterion
timing so default tuning has a side-by-side wall-clock + space view.
The bench is cfg(unix) and gated behind the existing spill-compression
feature, so default builds stay free of the zstd dev dependency.

* chore: refresh Cargo.lock
oferchen added a commit that referenced this pull request May 18, 2026
* bench(engine): SpillPolicy compression/granularity perf (#2349)

Add a criterion benchmark that sweeps the four SpillPolicy cells
(compression None vs Zstd-3, granularity WholeBatch vs PerItem)
against a forced-spill workload of 1000 mixed DeltaResult payloads,
plus a real SpillableReorderBuffer baseline with a 16 KiB threshold.

Each cell prints its simulated bytes-on-disk alongside the criterion
timing so default tuning has a side-by-side wall-clock + space view.
The bench is cfg(unix) and gated behind the existing spill-compression
feature, so default builds stay free of the zstd dev dependency.

* chore: refresh Cargo.lock
@oferchen
oferchen deleted the bench/spill-policy-perf branch May 19, 2026 15:12
oferchen added a commit that referenced this pull request Aug 24, 2026
* bench(engine): SpillPolicy compression/granularity perf (#2349)

Add a criterion benchmark that sweeps the four SpillPolicy cells
(compression None vs Zstd-3, granularity WholeBatch vs PerItem)
against a forced-spill workload of 1000 mixed DeltaResult payloads,
plus a real SpillableReorderBuffer baseline with a 16 KiB threshold.

Each cell prints its simulated bytes-on-disk alongside the criterion
timing so default tuning has a side-by-side wall-clock + space view.
The bench is cfg(unix) and gated behind the existing spill-compression
feature, so default builds stay free of the zstd dev dependency.

* chore: refresh Cargo.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant