perf: add concurrent keyspace mode (--concurrent flag) - #50
Merged
Conversation
adds an experimental mode that uses DashMap for lock-free concurrent access, bypassing the sharded channel architecture for GET/SET commands. benchmark results on 8-core VM: - SET: +13% throughput (1,010k → 1,142k ops/sec) - GET: +11% throughput (1,115k → 1,241k ops/sec) the improvement comes from eliminating the per-request channel overhead (mpsc send + oneshot reply) that exists in the sharded architecture. new files: - concurrent.rs: DashMap-backed ConcurrentKeyspace - concurrent_handler.rs: connection handler for concurrent mode usage: ember-server --concurrent
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
* perf: add concurrent keyspace mode (--concurrent flag) adds an experimental mode that uses DashMap for lock-free concurrent access, bypassing the sharded channel architecture for GET/SET commands. benchmark results on 8-core VM: - SET: +13% throughput (1,010k → 1,142k ops/sec) - GET: +11% throughput (1,115k → 1,241k ops/sec) the improvement comes from eliminating the per-request channel overhead (mpsc send + oneshot reply) that exists in the sharded architecture. new files: - concurrent.rs: DashMap-backed ConcurrentKeyspace - concurrent_handler.rs: connection handler for concurrent mode usage: ember-server --concurrent * chore: fmt and clippy fixes
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
adds an experimental
--concurrentflag that uses DashMap for lock-free concurrent access, bypassing the sharded channel architecture for GET/SET commands.benchmark results
IMPORTANT: previous benchmarks used single-threaded redis-benchmark, which bottlenecked the client. With
--threads 8, the true scaling behavior is revealed:concurrent mode is:
tested on GCP c2-standard-8 (8 vCPU Intel Xeon @ 3.10GHz)
what's new
ConcurrentKeyspace: DashMap-backed keyspace with lock-free access--concurrentflag: enables the new moderoot cause analysis
the sharded architecture has significant channel overhead:
every request crosses thread boundaries twice. with DashMap, connection handlers access the keyspace directly without any channel coordination.
design considerations
this is a tradeoff:
the concurrent mode is marked experimental. full feature parity with the sharded mode would require more work (lists, hashes, sorted sets, persistence).
what was tested