Repository navigation
bench(engine): DeletePlanMap insert/take contention vs alternatives (#2258) - #4261
Merged
Merged
Conversation
…2258) Adds a Criterion micro-benchmark that pits the current `Mutex<HashMap<PathBuf, DeletePlan>>` backing store for `DeletePlanMap` against `dashmap::DashMap` and a 16-shard `Vec<Mutex<HashMap>>` variant. Workloads sweep single-thread, 4/8/16-thread inserts and a 50/50 insert/take mix at 8 threads with deterministic, reproducible keys. Output feeds the DDP-A3 (#2253) follow-up: if any alternative shows a >2x speedup at high thread counts, the engine swaps the backing store to the winner; otherwise the existing shape stays. dashmap is added only as a `[target.'cfg(unix)'.dev-dependencies]` entry pinned to the workspace version (6.1); no runtime dependency change. The bench file is `#![cfg(unix)]`-gated to match the existing criterion dev-dep gating in the engine crate.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…2258) (#4261) Adds a Criterion micro-benchmark that pits the current `Mutex<HashMap<PathBuf, DeletePlan>>` backing store for `DeletePlanMap` against `dashmap::DashMap` and a 16-shard `Vec<Mutex<HashMap>>` variant. Workloads sweep single-thread, 4/8/16-thread inserts and a 50/50 insert/take mix at 8 threads with deterministic, reproducible keys. Output feeds the DDP-A3 (#2253) follow-up: if any alternative shows a >2x speedup at high thread counts, the engine swaps the backing store to the winner; otherwise the existing shape stays. dashmap is added only as a `[target.'cfg(unix)'.dev-dependencies]` entry pinned to the workspace version (6.1); no runtime dependency change. The bench file is `#![cfg(unix)]`-gated to match the existing criterion dev-dep gating in the engine crate.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…2258) (#4261) Adds a Criterion micro-benchmark that pits the current `Mutex<HashMap<PathBuf, DeletePlan>>` backing store for `DeletePlanMap` against `dashmap::DashMap` and a 16-shard `Vec<Mutex<HashMap>>` variant. Workloads sweep single-thread, 4/8/16-thread inserts and a 50/50 insert/take mix at 8 threads with deterministic, reproducible keys. Output feeds the DDP-A3 (#2253) follow-up: if any alternative shows a >2x speedup at high thread counts, the engine swaps the backing store to the winner; otherwise the existing shape stays. dashmap is added only as a `[target.'cfg(unix)'.dev-dependencies]` entry pinned to the workspace version (6.1); no runtime dependency change. The bench file is `#![cfg(unix)]`-gated to match the existing criterion dev-dep gating in the engine crate.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…2258) (#4261) Adds a Criterion micro-benchmark that pits the current `Mutex<HashMap<PathBuf, DeletePlan>>` backing store for `DeletePlanMap` against `dashmap::DashMap` and a 16-shard `Vec<Mutex<HashMap>>` variant. Workloads sweep single-thread, 4/8/16-thread inserts and a 50/50 insert/take mix at 8 threads with deterministic, reproducible keys. Output feeds the DDP-A3 (#2253) follow-up: if any alternative shows a >2x speedup at high thread counts, the engine swaps the backing store to the winner; otherwise the existing shape stays. dashmap is added only as a `[target.'cfg(unix)'.dev-dependencies]` entry pinned to the workspace version (6.1); no runtime dependency change. The bench file is `#![cfg(unix)]`-gated to match the existing criterion dev-dep gating in the engine crate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/engine/benches/delete_plan_map_contention.rs, a Criterion bench that pits the currentMutex<HashMap<PathBuf, DeletePlan>>backing store forDeletePlanMapagainstdashmap::DashMapand a 16-shardVec<Mutex<HashMap>>variant.delete_plan_map_contention:100k_inserts_single_thread,100k_inserts_{4,8,16}_threads, andmixed_50_50_insert_takeat 8 threads. Keys are deterministicPathBuf::from(format!("dir/{group}/{n}"))values so runs reproduce across machines.dashmapas a[target.'cfg(unix)'.dev-dependencies]entry (workspace version 6.1); no runtime dependency change. Registers the bench under[[bench]]and gates the file with#![cfg(unix)]to match the existing criterion dev-dep gating.Why
DDP-B4 (#2258) is the evidence step for the backing-store choice flagged in
plan_map.rsand in the DDP-A3 (#2253) follow-up. If any alternative shows a >2x speedup at the 8/16-thread or mixed workloads, a follow-up PR swapsplan_map.rsto the winner; otherwise the existing shape stays as the simplest correct shape.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --no-deps -- -D warningscargo bench -p engine --bench delete_plan_map_contention -- --quickon Linux to smoke the harness