Skip to content

perf(async): compare warmed client/server APIs under sustained load - #333

Merged
MisterVVP merged 4 commits into
release/v0.6.0from
codex/332-async-performance-comparisons
Nov 12, 2026
Merged

MisterVVP merged 4 commits into
release/v0.6.0from
codex/332-async-performance-comparisons

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #332. Based on release/v0.6.0, including #331.

The existing performance CI job compares sync and async servers for every supported in-memory wire workload. Paired throughput, latency, and resource tables keep raw runs in JSON/CSV instead of duplicating Markdown rows. PostgreSQL remains sync-only; its storage is unchanged.

  • Both performance steps now run once, and normal runner comparisons default to one pass. CI's broad matrix drops from 2,292 to 764 rows; sustained coverage drops from 234 to 78. Scenario coverage, concurrency levels, warmup, and three-second sustained measurements are preserved. Explicit local repetitions remain available for variance analysis.
  • Single-run summaries say so and show throughput ranges as n/a. Operation errors now print their scenario, transport, client/server modes, and counts before comparison validation returns failure.
  • Warm the measured clients through the selected API. GetTask and both ListTasks workloads support all four client/server combinations through bounded async callbacks; streaming retains its common observer API. Include 100 ms held subscriptions, measuring cancellation latency separately.
  • Retain the two small SDK changes: move parsed HTTP requests into handlers while preserving connection policy, and recycle gRPC write-acknowledgement allocations.

Recalculated results

Fresh single-pass local measurements, with two CPUs divided equally between driver and server; these are observations, not variance estimates. The SDK code is unchanged by this follow-up.

  • Broad in-memory matrix: 480 rows, 480,000 operations, zero errors.
  • Sustained matrix: 78 rows (72 wire), 1,617,371 wire operations, 36 complete server-mode pairs, zero errors.

GetTask at concurrency 64, operations/second:

Transport Sync client / sync server Sync client / async server Async client / sync server Async client / async server Fully async / fully sync
grpc 23,756 26,746 24,339 32,788 1.38×
http_json 12,356 14,168 13,707 15,071 1.22×
jsonrpc 6,675 7,730 6,609 7,608 1.14×

Async is useful for concurrent unary throughput and thread use, but performance work is not finished:

  • At concurrency 1, fully async GetTask reaches 0.68× / 0.73× / 0.78× fully synchronous throughput for gRPC / HTTP+JSON / JSON-RPC. The median latency cost is approximately 47 / 73 / 84 microseconds on these immediately ready in-memory calls.
  • At concurrency 64, GetTask client threads fall from 73 to 16 for gRPC and 69 to 10 for HTTP+JSON/JSON-RPC; server threads fall from 72–73 to 21–27.
  • Finite-stream async/sync server ratios are 1.00× / 0.99× / 0.99×: essentially parity. The gRPC client still uses a blocking reader thread per stream, and the driver waits per operation; its process samples 137 threads at concurrency 64 with either server mode. Native callback-driven gRPC streaming and a callback-driven stream driver are the clearest next targets, followed by scheduling/deadline-wakeup overhead.
  • Across all 49 broad workloads using the existing synchronous client, the median server ratio is 0.79× at concurrency 1 and 1.09× at concurrency 64. This is a workload comparison, not a universal SDK speedup.

The previous CI performance step took about 45 minutes for three broad passes and failed on one async HTTP+JSON operation at concurrency 64; sustained CI measurements were consequently skipped. The new local run did not reproduce that failure. Errors remain fatal and invalidate ratios; a clean new CI run is still needed. The row reduction removes roughly two-thirds of matrix execution, not dependency-build time. Updated reports remain in the existing job summary/artifact (normal and normal/sustained); no generated reports are committed.

Validation

  • ./scripts/verify_changes.sh: passed (exit 0); 1,175 tests passed, three skipped, and all 188 source/test/example lint checks passed.
  • 57 runner tests, including single-pass defaults/reporting, explicit repetition overrides, detailed operation errors, four client/server combinations, and held subscriptions.
  • Mandatory TCK: 215 passed, 14 skipped, 34 deselected, zero failures; checkout unchanged. Required performance smoke: 54 rows, zero errors.
  • Exact CI formatting, mdBook, and actionlint: passed.
  • Dependencies are unchanged. OSV scanning remains unverified because its API returns HTTP 403.
  • The existing TCK HTTP_JSON-SVC-001 SHOULD Content-Type conflict remains tracked in [Feature]: [Release v0.6.0] Finalize SDK packaging, versions, and documentation #328; the previous CI run still failed that check.

Authorship and AI usage

  • Contains substantive content written by a human
  • Contains substantive content generated by an AI agent

Checklist

  • ./scripts/verify_changes.sh passed locally
  • Docs updated

@MisterVVP MisterVVP added AI agent AI agent contribution performance Performance improvement related tasks based on benchmark results. Performance tests changes. labels Nov 12, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP changed the title feat(perf): compare sync and async servers in existing reports perf(async): expand paired coverage and trim transport allocations Nov 12, 2026
@MisterVVP MisterVVP self-assigned this Nov 12, 2026
@MisterVVP MisterVVP changed the title perf(async): expand paired coverage and trim transport allocations perf(async): compare warmed client/server APIs under sustained load Nov 12, 2026
Comment thread .github/workflows/ci.yml Resolved
@MisterVVP
MisterVVP marked this pull request as ready for review November 12, 2026 19:56
@MisterVVP
MisterVVP merged commit 2e3f388 into release/v0.6.0 Nov 12, 2026
22 of 23 checks passed
@MisterVVP
MisterVVP deleted the codex/332-async-performance-comparisons branch November 12, 2026 20:13
@MisterVVP MisterVVP mentioned this pull request Nov 13, 2026
1 of 2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution performance Performance improvement related tasks based on benchmark results. Performance tests changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Extend existing performance tests with sync vs async I/O comparisons

1 participant