Repository navigation
test(bench): measure single-user latency and max throughput - #56
Merged
Merged
Conversation
- execute.benchmark: report µs and add erc20 and nested-CALL workloads. The bare counter finished the gas-limit search in one run, so it did not show the cost of that search. - counter/harness benchmarks: capture console output instead of printing it, so they measure the runtime and not terminal I/O. Report evm execute / accept batch / persist batch durations from the runtime's debug logs. - counter benchmark: run with 1 client, 32 clients, and open-loop senders at 4,000 and 8,000 mutations/s. One sequential client cannot show batching or pipelining, and closed-loop clients move in lockstep with batches.
The plan describes runtime-batch.ts, main.rs, and an IPC sidecar, which no longer exist. Measured on the napi addon, the per-call wrapper (JSON, semaphore, Effect) costs about 4us against about 96us of native EVM time per mutation, so batching execute calls would gain little.
Use one Harness benchmark with production defaults, so submit and block polling run. Remove the counter benchmark, the log-phase parser and the synthetic EVM workloads. Add a benchmark script that builds the release typewriter-evm addon first.
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
The benchmarks now measure the two numbers that matter:
harness.benchmark.ts: it usesHarness.solas the Typewriter app with the production defaults (FIFO sequencing, 300 ms submit, 200 ms block polling). Submit and block polling run as they do in production. It sends 1,000 mutations one at a time to measure latency. Then it sends 10,000 mutations at the same time to measure maximum throughput.counter.benchmark.ts, the shared benchmark utilities, andPLAN_execute_many.md. The plan describes files that do not exist now.bun run benchmarkscript inpackages/typewriter: it builds the releasetypewriter-evmaddon before the benchmark runs. Thetestscript builds a debug addon, and a benchmark on the debug addon is approximately 12 times slower (187 mutations/s).typewriter-evmexecute benchmark: no changes frommain.Results (m8a.large, release addon)
Known issues found by this benchmark
withSpeculativeStateLock, andacceptBatchuses the same lock. In a test run with submit turned off, single-user p99 was 12.85 ms. With submit on, it was 756 ms (debug addon for both runs).halt: OutOfGas(MemoryLimit)fromexecute. The probable cause is that submit puts all mutations accepted since the last submit into one transaction, with no size limit. The benchmark test passes, butbun testreports one unhandled error. A fix for this is not in this PR.Test plan
bun run typecheckbiome checkon the changed filesDATABASE_URL=... bun run benchmarkinpackages/typewriter🤖 Generated with Claude Code

Confidence Score: 5/5
The PR appears safe to merge; no actionable new issue remains.Summary
The PR replaces the counter benchmark with a harness benchmark that measures single-user latency and concurrent throughput.
executeManyplanning document.Reviews (2) · Last reviewed commit: "test(bench): measure single-user latency..." · Reviewed by Greptile