Skip to content

test(benchmark): add criterion microbenchmarks and e2e benchmark CLI tool#125

Merged
slow2342 merged 1 commit into
mainfrom
test/benchmarks
Jun 13, 2026
Merged

test(benchmark): add criterion microbenchmarks and e2e benchmark CLI tool#125
slow2342 merged 1 commit into
mainfrom
test/benchmarks

Conversation

@slow2342

Copy link
Copy Markdown
Owner

Summary

  • Add Criterion microbenchmarks for storage engine, Raft log store, and codec serialization
  • Add aether-bench CLI tool for end-to-end gRPC benchmark testing
  • Add benchmark compile check to CI pipeline

Changes

  • benches/storage.rs — RocksDB StorageEngine benchmarks: put/get/delete/batch_write/scan with varying data sizes
  • benches/raft_store.rs — Raft log store benchmarks: append_entries/entries_read/save_hard_state/compact
  • benches/codec.rs — Serialization benchmarks: rkyv, MVCC key encoding, KeyIndex encode/decode
  • src/bin/aether-bench/ — End-to-end benchmark CLI tool:
    • put — concurrent write benchmark with round-robin worker distribution
    • range — concurrent read benchmark with data pre-fill
    • report — latency percentiles (P10-P99.9), RPS, wall time, error distribution
  • Cargo.toml — Add criterion dev-dependency, [[bench]] targets, [[bin]] target, default-run
  • .github/workflows/ci.yml — Add cargo bench -- --test compile check

Benchmark results (single node, release mode)

Scenario RPS P50 P99
PUT 1 client 4,057 0.24 ms 0.33 ms
PUT 10 clients 14,139 0.68 ms 1.10 ms
RANGE 10 clients 31,701 0.31 ms 0.52 ms

How to verify

cargo bench -- --test                    # Verify criterion benchmarks compile
cargo build --bin aether-bench           # Verify CLI tool compiles
cargo bench                              # Run all criterion benchmarks
cargo run --bin aether-bench -- put --total 1000 --val-size 256  # Run e2e benchmark

…tool

Add two layers of performance benchmarking:

Layer 1 - Criterion microbenchmarks (benches/):
- storage: RocksDB put/get/delete/batch_write/scan with varying data sizes
- raft_store: Raft log append/entries_read/save_hard_state/compact
- codec: rkyv serialization, MVCC key encoding, KeyIndex encode/decode

Layer 2 - End-to-end benchmark CLI tool (src/bin/aether-bench/):
- put: concurrent write benchmark with round-robin worker distribution
- range: concurrent read benchmark with data pre-fill
- report: latency percentiles (P10-P99.9), RPS, wall time, error distribution
- Uses tonic gRPC client directly, unbounded channels for zero backpressure

CI: add cargo bench -- --test to verify benchmarks compile.
@slow2342
slow2342 merged commit bf27335 into main Jun 13, 2026
6 checks passed
@slow2342
slow2342 deleted the test/benchmarks branch June 13, 2026 17:14
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