Repository navigation
Conversation
One workload, throughput only, printed to the terminal, said little: not the tail the project's motivation rests on, not whether a gain survives a bigger element type, and nothing about how much two runs differ by themselves. Five workloads, each one source built as baseline, optimized and direct: spsc_throughput (the old benchmark), spsc_latency (push-to-pop latency at a paced rate: p50, p99, p99.9, max), spsc_payload (a 64-byte record), spsc_same_thread (one thread pushes a batch and pops it, which a bounded ring would deadlock on), and mpsc_control (two producers, must not be substituted). run.sh holds whether each optimized build must be substituted and fails if it disagrees, so no column can silently measure the wrong thing; each workload fails if what it received is wrong. Variants run interleaved, RUNS times. report.py writes RESULTS.md: medians, latency, spread, and the commit, toolchain, machine and pinning they came from. The control's two builds bound the noise, and the report states it: they run the same queue code and still measured 10 to 13 percent apart on an M1 Pro, in either order, so the report says a difference that size means nothing. The queue in each workload is a global touched only at the call sites, because a helper taking it would be a use --select-queue-impl cannot retarget. queue_bench.cpp and spsc_direct.cpp are replaced by spsc_throughput.cpp, which is both. Not in CI, on purpose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first two sessions put the substituted queue's p99 at 1.3 µs and at 11 µs, and in one run of five every variant's latency jumped by orders of magnitude at once. A median over five runs hides that, so the report now lists each run's p99 beside the medians, and the claims in the README and the runtime header say what the runs support rather than what the best one did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apple M1 Pro, macOS, threads not pinned, five interleaved runs per variant. Substituted throughput is 2.4 to 3.0 times the baseline's; median push-to-pop latency falls from 2.6 µs to 208 ns and p99 from about 1 ms to 4 µs. The control measured 18 percent apart between two builds of the same queue code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three sessions put mpsc_control's optimized build 6, 13 and 18 percent ahead of its baseline, always in that direction and in either run order. The README called that noise; it is a consistent difference between two binaries that differ only by the erased anchor. The conclusion drawn from it stands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Closing together with the stack below it, since the substitution it measures is replaced in #10. The benchmarks there run under a reservation protocol on the lab's server (reserved cores, siblings offline, governor fixed, turbo off, interleaved repetitions, bootstrap intervals), and #10 adds workloads for the inline queue and for batched pushes. The idea of keeping a generated RESULTS.md with the environment and every run's spread is a good one for that suite; the results of the latest legs are recorded under |
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.
Stacked on #8 (
test/end-to-end-from-cpp).What this changes
Turns the one benchmark from #7 into a suite whose results are written to
benchmarks/RESULTS.md. It is run by hand and deliberately not added to CI: shared runners are too noisy for timings to mean anything.Five workloads in
benchmarks/workloads/, each one source built as baseline (wtc::queue<T>, lifted and lowered back unchanged), optimized (plus--select-queue-impl) and, where it is safe, direct (spsc_queue<T>by hand, the ceiling):spsc_throughputqueue_bench.cppandspsc_direct.cpp)spsc_latencyspsc_payloadspsc_same_threadmpsc_controlWhat keeps the numbers honest:
run.shstates, per workload, whether the optimized build must be substituted, and fails if it disagrees, so no column can silently measure the wrong program.RUNStimes.report.pywrites medians, the spread, each run's p99, and the commit, toolchain, machine and pinning.RESULTS.mdis committed on its own, after a run, so the commit it names is the one that was measured.The queue in each workload is a global touched only at the call sites (
bench.hpp), because a helper taking it would be a use--select-queue-implcannot retarget.Results (M1 Pro, macOS, threads not pinned)
spsc_throughputspsc_payloadspsc_same_threadspsc_latencyp50 / p99Three things the sessions showed that a single run would have hidden, all written into the README:
runtime/spsc_queue.hppare worded to what all the runs support.shared_ptrallocation per pop, kept to matchtry_pop's interface.How it was checked
All five workloads are substituted, or kept, as
run.shrequires, and every variant's correctness checks passed on every run of three full sessions.check-wtcis unaffected (33 of 33). Not measured yet: pinned runs on Linux, bursty load, memory.Checklist
🤖 Generated with Claude Code