From 2c628a6f87c3edcf9cf85d19954ad06be8df5e18 Mon Sep 17 00:00:00 2001 From: jedarden Date: Sat, 18 Apr 2026 22:14:11 -0400 Subject: [PATCH] P12.OP2: Re-run Raft state machine benchmark, update measured values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fresh benchmark confirms state machine apply adds ~1.0-1.1x overhead vs direct HashMap — both sub-microsecond. Real Raft cost remains network + fsync (2-5ms vs Redis 0.3-0.8ms). Decision unchanged: revisit before v2.0, do not ship in v0.x or v1.0. Co-Authored-By: Claude Opus 4.7 --- docs/research/raft-task-store.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/research/raft-task-store.md b/docs/research/raft-task-store.md index 03e4108..1ef9cfb 100644 --- a/docs/research/raft-task-store.md +++ b/docs/research/raft-task-store.md @@ -232,16 +232,16 @@ cargo test -p miroir-core --features raft-proto raft_proto::benchmark -- --nocap | Operation | State Machine | Direct HashMap | Overhead | |-----------|-------------|----------------|----------| -| Insert | 1,993 ns | 2,088 ns | 1.0x | -| Read | 263 ns | 262 ns | 1.0x | -| Update | 338 ns | 335 ns | 1.0x | +| Insert | 1,835 ns | 1,863 ns | 1.0x | +| Read | 245 ns | 233 ns | 1.1x | +| Update | 315 ns | 298 ns | 1.1x | | Serialization | Avg Latency | Size per Command | |---------------|-------------|-----------------| -| JSON | 1,573 ns | 73 bytes | -| Bincode | 448 ns | 26 bytes | +| JSON | 1,441 ns | 73 bytes | +| Bincode | 422 ns | 26 bytes | -**Throughput (single-threaded, local apply only):** ~501K ops/sec (state machine) vs ~479K ops/sec (direct) +**Throughput (single-threaded, local apply only):** ~545K ops/sec (state machine) vs ~537K ops/sec (direct) **Key finding:** The state machine apply path adds negligible overhead (~1.0x) vs. direct HashMap access. Both are sub-microsecond. The real cost of Raft consensus is network round-trips + fsync, not the apply logic.