Skip to content

report median and p99 from the pith grpc client - #620

Merged
kacy merged 1 commit into
mainfrom
grpc-client-percentiles
Jul 29, 2026
Merged

report median and p99 from the pith grpc client#620
kacy merged 1 commit into
mainfrom
grpc-client-percentiles

Conversation

@kacy

@kacy kacy commented Jul 29, 2026

Copy link
Copy Markdown
Owner

summary

the pith grpc benchmark client reported an "average" that was wall clock
divided by total calls — under conc=8 that divides one stream's time across
eight, so it read ~8x better than the go and rust medians while measuring
something different. the stale comment blamed millisecond clock resolution,
which predates the monotonic nanosecond clock.

each call is now timed with time.mono_nanos, workers push latencies into
per-worker lists, and the merged sorted set produces the same nearest-rank
median and p99 the go client prints, formatted the same way. the performance
doc's grpc table is refreshed from a three-round interleaved rerun on
identical metrics, and it now says plainly that the previous average
flattered pith.

what was tested

built and run against the local tls server: three interleaved rounds, both
payload sizes, all three clients prebuilt. medians of the rounds are what
the doc records. make docsite-check passes; nothing outside bench/ and
the doc changed.

notes

worker latencies come back through a shared list handle rather than a task
return value: extracting an awaited result with a list payload miscompiles
both ways today (unwrap_or emits an unresolvable bare call; .ok trips
the ir contract's field-offset check at build). filed as its own issue; the
client comments explain the shape.

the client printed an "average" computed as wall clock over total calls,
which under eight-way concurrency divides one stream's worth of time across
all eight — it read almost an order of magnitude better than the go and rust
medians while measuring something else entirely. the comment blaming
millisecond clock resolution predated the monotonic nanosecond clock.

every call is now timed with mono_nanos, each worker pushes its latencies
into a shared per-worker list, and the merged sorted set yields the same
nearest-rank median and p99 the go client prints, in the same duration
format. the doc table is refreshed from a three-round interleaved rerun with
all three clients on identical metrics: pith 7476 calls/sec at 954us median
against go's 14731 at 471us and rust's 12005 at 591us on the 16-byte
payload.

workers hand latencies back through a shared list handle rather than a task
result, because extracting an awaited result with a list payload miscompiles
both ways today — unwrap_or emits an unresolvable call and .ok trips the ir
contract's field-offset check. that is filed separately; the comment in the
client says why the shape is what it is.
@kacy
kacy merged commit f2c8ee2 into main Jul 29, 2026
2 checks passed
@kacy
kacy deleted the grpc-client-percentiles branch July 29, 2026 13:49
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.

1 participant