fix(site): read the homepage benchmark figures from one place - #81
Merged
kparisa merged 2 commits intoSep 3, 2026
Merged
Conversation
The hero advertised "~1 ms" labelled "Avg Write Latency". The latency table further down the same page gives the producer average as 0.466 ms and the P99 as 0.976 ms, so the hero was quoting a P99 under an average label, understating the measured average by more than half. The figures were written out four times: once in page.tsx and three times in benchmark-chart.tsx, in the average constants, the table rows and the stat tiles. They now come from a single exported LATENCY_MS in benchmark-chart.tsx, which the hero imports. The rendered page is unchanged apart from the hero, which now reads 0.5 ms.
justinmclean
force-pushed
the
site/benchmark-figures-single-source
branch
from
September 3, 2026 03:00
3e463df to
fb8649f
Compare
The build failed with "Cannot read properties of undefined (reading 'avg')" while collecting page data for /. benchmark-chart.tsx is a client component, so a server component importing a value from it receives a client reference rather than the data, and heroStats evaluates at module scope. LATENCY_MS now lives in src/lib/benchmark.ts, which carries no "use client", and both the page and the chart import it from there. No figures change.
kparisa
self-requested a review
September 3, 2026 06:07
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.
The hero advertised "~1 ms" labelled "Avg Write Latency". The latency table two sections below, on the same page, gives the producer average as 0.466 ms and the P99 as 0.976 ms, so the hero was quoting a P99 under an average label and understating the measured average by more than half.
The numbers were hardcoded twice, in page.tsx and in benchmark-chart.tsx, which is what let them drift apart. They now come from src/lib/benchmark.ts: the latency table, the stat tiles and the hero all read the same values, and the hero renders 0.5 ms from the producer average rather than a literal.
Update the figures in one file when a new benchmark run is published.