Skip to content

fix(site): read the homepage benchmark figures from one place - #81

Merged
kparisa merged 2 commits into
apache:mainfrom
justinmclean:site/benchmark-figures-single-source
Sep 3, 2026
Merged

fix(site): read the homepage benchmark figures from one place#81
kparisa merged 2 commits into
apache:mainfrom
justinmclean:site/benchmark-figures-single-source

Conversation

@justinmclean

Copy link
Copy Markdown
Member

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.

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
justinmclean force-pushed the site/benchmark-figures-single-source branch from 3e463df to fb8649f Compare September 3, 2026 03:00
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
kparisa self-requested a review September 3, 2026 06:07

@kparisa kparisa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@kparisa
kparisa merged commit 998beff into apache:main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants