feat: criterion micro-benchmarks for hot path - #42
Merged
Conversation
add criterion benchmark suites for the two performance-critical crates: ember-core (keyspace.rs): - keyspace_get: HashMap lookup + Bytes clone at 64B/256B/1KB/16KB - keyspace_set_overwrite: overwrite path with memory tracking - keyspace_set_with_expiry: TTL bookkeeping overhead - keyspace_mixed: alternating 50/50 get/set on 10k keys - memory_entry_size: cost of memory::entry_size() calculation ember-core (engine.rs): - engine/route_get: full async path through mpsc + oneshot channels - engine/route_set_64B: SET through engine routing layer ember-protocol (protocol.rs): - resp3_parse: PING, GET, SET at 64B and 1KB - resp3_serialize: simple, bulk 64B, bulk 1KB - command_from_frame: GET and SET command dispatch run with: cargo bench --workspace
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
feat: criterion micro-benchmarks for hot path
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
bench,bench-core,bench-protocolMakefile targetstested
cargo bench -p emberkv-core -- --test— all 14 benchmark cases compile and passcargo bench -p ember-protocol -- --test— all 9 benchmark cases compile and passcargo clippy --workspace -- -D warnings— cleancargo bench -p emberkv-core -- keyspace_get/64Bto verify real output (~45ns per GET on 64B value)design considerations
Keyspace::new()without async or channels, isolating raw data structure performance from routing overheadb.to_async(&rt)with a multi-thread tokio runtime to measure the real mpsc/oneshot channel cost