chore(benchmark): add Redis write benchmark and record the 0.18 to 0.19 measurements - #135
Merged
Conversation
…19 measurements Adds a maintainer benchmark for the write path (server-side cost per write from INFO commandstats plus client latency percentiles, tracked and untracked, 100 B to 1 MiB) mirroring the methodology used to measure the 0.18.0 to 0.19.0 protocol change, and documents it in the README benchmark section.
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
pnpm benchmark:redis-write, a maintainer benchmark for the Redis write path, and records the measured server-side cost of the 0.18.0 → 0.19.0 write-protocol change (#131). The 0.19.0 release notes carried an expectation extrapolated from #123's read measurements ("expect ~95% server-side command-time reduction at 1 MiB writes"); this PR replaces that expectation with numbers.Measured: 0.18.0 (Lua write scripts) vs 0.19.0 (native
SET+ payload-free stamp)Three full runs per version, sequential awaited writes via the node-redis adapter against a dedicated local Redis 6.2 container. Server-side cost is
INFO commandstatsµsec summed over the commands the client dispatches per logical write (0.18.0 tracked:EVALSHA; 0.19.0 tracked:SET+EVALSHA; theEVALSHAentry envelopes script-internal calls), divided by writes. Ranges are min–max across the three runs.Client-side latency (localhost, RTT-dominated): 1 MiB tracked p50 improved from 772–861 µs to 566–703 µs (~25%); small payloads are roughly flat with overlapping ranges.
Readings:
SETversus a payload-carrying script.Methodology caveats
Single machine (Apple Silicon laptop, Docker Desktop VM) with unrelated containers running; sequential awaited writes (per-op cost, not throughput under pipelined concurrency); Redis 6.2 only; three runs. Treat the small-payload cells as "no measurable difference" rather than precise deltas — the µs-scale numbers there sit at the environment's noise floor. The 100 KiB and 1 MiB signals are stable across runs and large relative to noise.
What ships in this PR
scripts/benchmark-redis-write.mjs+pnpm benchmark:redis-write— the same methodology, pointed at the local build, for future regression checks (maintainer tool, not part of the published package, no timing thresholds asserted).