Skip to content

Commit 1ce5abe

Browse files
zzylolclaude
andauthored
Profile existing SimpleMapStore: Criterion benchmarks for insert, query, and store analyze (#211)
* Add Criterion benchmarks for SimpleMapStore performance profiling Adds six benchmark groups to measure the existing SimpleMapStore's algorithm complexity before the inverted-index replacement in PR #175: - insert/batch_size: O(B) insert scaling across 10–5000 items - insert/num_agg_ids: lock overhead across 1–200 aggregation IDs - query/range_store_size: O(W·log W + k) range query across 100–5000 windows - query/exact_store_size: O(1) HashMap lookup verified across store sizes - store_analyze/num_agg_ids: O(A) earliest-timestamp scan across 10–1000 IDs - concurrent_reads/thread_count: write-lock serialisation with 1–8 threads Both Global and PerKey lock strategies are profiled in each group. Results land in target/criterion/ as HTML reports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix cargo fmt violations in bench and add dummy bench to Dockerfile - Apply rustfmt to simple_store_bench.rs (alignment, closure brace style) - Add dummy benches/simple_store_bench.rs stub to Dockerfile dep-cache layer so cargo can parse the [[bench]] manifest entry during docker build Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Expand benchmarks: larger ranges, KLL sketch accumulator - Increase parameter ranges (batch: 100→50k, windows: 500→50k, agg IDs: 1→1k/5k, threads: 1→16) - Add DatasketchesKLLAccumulator k=200 variant to insert and range query benchmarks to expose realistic sketch clone cost - KLL results show ~10x overhead on range queries vs trivial SumAccumulator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix asap-planner-rs Dockerfile: add dummy bench stub for simple_store_bench Same fix as asap-query-engine/Dockerfile — the workspace Cargo.toml for asap-query-engine declares [[bench]] simple_store_bench, so Cargo requires the file to exist even during dependency-only builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0866684 commit 1ce5abe

5 files changed

Lines changed: 594 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 179 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asap-planner-rs/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ COPY asap-planner-rs/Cargo.toml ./asap-planner-rs/
1313

1414
# Create dummy source files so Cargo can resolve all workspace members
1515
RUN mkdir -p asap-query-engine/src && echo "fn main() {}" > asap-query-engine/src/main.rs && \
16+
mkdir -p asap-query-engine/benches && echo "fn main() {}" > asap-query-engine/benches/simple_store_bench.rs && \
1617
mkdir -p asap-planner-rs/src && echo "fn main() {}" > asap-planner-rs/src/main.rs && \
1718
echo "pub fn placeholder() {}" >> asap-planner-rs/src/lib.rs
1819

asap-query-engine/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ tracing-appender = "0.2"
6060

6161
[dev-dependencies]
6262
tempfile = "3.20.0"
63+
criterion = { version = "0.5", features = ["html_reports"] }
64+
65+
[[bench]]
66+
name = "simple_store_bench"
67+
harness = false
6368

6469
[features]
6570
#default = ["lock_profiling", "extra_debugging"]

asap-query-engine/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ COPY asap-planner-rs/Cargo.toml ./asap-planner-rs/
2121

2222
# Create dummy source files so Cargo can resolve all workspace members
2323
RUN mkdir -p asap-query-engine/src && echo "fn main() {}" > asap-query-engine/src/main.rs && \
24+
mkdir -p asap-query-engine/benches && echo "fn main() {}" > asap-query-engine/benches/simple_store_bench.rs && \
2425
mkdir -p asap-planner-rs/src && echo "fn main() {}" > asap-planner-rs/src/main.rs && \
2526
echo "pub fn placeholder() {}" >> asap-planner-rs/src/lib.rs
2627

0 commit comments

Comments
 (0)