Skip to content

feat: add --shards flag and improve benchmark comparisons - #44

Merged
kacy merged 1 commit into
mainfrom
feat/benchmark-improvements
Feb 7, 2026
Merged

feat: add --shards flag and improve benchmark comparisons#44
kacy merged 1 commit into
mainfrom
feat/benchmark-improvements

Conversation

@kacy

@kacy kacy commented Feb 7, 2026

Copy link
Copy Markdown
Owner

summary

  • adds --shards N flag to ember-server for controlling worker thread count (defaults to available CPU cores)
  • updates benchmark script to run meaningful comparisons:
    • single-threaded: ember (1 shard) vs redis — fair comparison of per-core efficiency
    • multi-threaded: ember (all cores) vs dragonfly — thread-per-core architecture comparison
    • scaling efficiency: ember multi vs ember single — shows how well sharding scales
  • adds dragonfly support (auto-detected if installed)
  • adds --quick flag for reduced test matrix

tested

bash bench/compare-redis.sh --ember-only --quick

=== benchmark configuration ===
cpu cores:    8
requests:     100000
clients:      50
pipeline:     16

--- single-threaded comparison (ember 1 shard vs redis) ---
SET (64B, P=16)     1,136,363
GET (64B, P=16)     1,369,863
...

--- multi-threaded comparison (ember 8 shards vs dragonfly) ---
SET (64B, P=16)     1,219,512
GET (64B, P=16)     1,282,051
...

--- scaling efficiency (ember multi-core vs single-core) ---
SET (64B, P=16)     1,219,512     1,136,363     1.1x
...

note: scaling appears limited because redis-benchmark is single-threaded. for real multi-core stress testing, would need to run multiple benchmark processes in parallel.

design notes

  • --shards 0 is rejected with an error
  • shard count is logged on startup: ember server starting... shards=8
  • dragonfly started with --dbfilename "" to disable persistence (matches redis --save "")

- add --shards N flag to ember-server to control shard count
  (defaults to available CPU cores)
- update benchmark script to test both single-shard and multi-shard
- add dragonfly support for multi-threaded comparison
- add scaling efficiency section to show multi-core benefits
- add --quick flag for reduced test matrix
- document all new options in bench/README.md
@kacy
kacy merged commit 92a4a9f into main Feb 7, 2026
5 checks passed
@kacy
kacy deleted the feat/benchmark-improvements branch February 7, 2026 20:06
kacy added a commit that referenced this pull request Feb 11, 2026
feat: add --shards flag and improve benchmark comparisons
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