Skip to content

perf(http): share native request ingress across bindings - #338

Merged
MisterVVP merged 10 commits into
perf/grpc-client-streamingfrom
perf/async-server-transport
Nov 20, 2026
Merged

MisterVVP merged 10 commits into
perf/grpc-client-streamingfrom
perf/async-server-transport

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Route native HTTP request preparation through the dispatcher runtime when the server uses AsyncRuntime. REST, JSON-RPC, discovery, and SSE share the same ingress choice.
  • Add regression tests for JSON-RPC shutdown draining and dispatcher-backed discovery and ListTasks. Add benchmarks for client concurrency, dispatcher overhead, and cancellable waits.
  • Require no regression in mandatory TCK compliance against the target branch, checking both the score and previously passing requirements. Contributor policy

Measured performance

Native HTTP ingress compared with 5202055

Workload Throughput, baseline → candidate p99, baseline → candidate
JSON-RPC GetTask, C16 7,301 → 8,063 req/s (+10.4%) 4.13 → 3.58 ms (−13.3%)
JSON-RPC GetTask, C64 7,552 → 8,263 req/s (+9.4%) 17.41 → 20.88 ms (+19.9%)
JSON-RPC GetTask, C256 8,654 → 8,528 req/s (−1.5%) 45.33 → 48.73 ms (+7.5%)

These percentages use (candidate / baseline − 1) × 100 on the reported medians. For example, (8,263 / 7,552 − 1) × 100 = 9.4%. The C64 throughput gain came with higher p99.

In a separate sync-versus-async test on the starting branch, a simulated 1 ms HTTP wait at C256 went from 9,899 to 14,111 req/s (+42.5%) and from 120.40 to 30.07 ms p99 (−75.0%). The server thread count went from 265 to 21 (−92.1%). This test measures the effect of suspending the request, independently of the ingress change above.

Topology and serialization follow-up

The corrected one-core topology sweep completed 684 samples with zero errors across C1, C16, C64, and C256. Four shared dispatcher workers at C64 moved real JSON-RPC median throughput from 18,064 to 19,299 req/s, and real gRPC from 46,696 to 41,110 req/s. The median changes calculated within each interleaved pair were +7.5% and −12.6%, respectively. Real JSON-RPC at C256 lost 4.0% throughput and gained 15.1% p99 by the same paired calculation. The local CPU quota supported one dedicated server core and one client core.

The direct JSON-RPC envelope experiment reduced isolated serialization from 14.59 to 7.54 µs (−48.3%, or 1.94× as many serializations per unit time). Real async JSON-RPC C1 throughput improved 7.3% by the paired calculation. At C256 the real sync server lost throughput and p99 increased 9.0% with the sync load driver and 13.0% with the async load driver. Those C256 results ruled out the candidate.

The C64 native trace measured 390.52 µs p99 waiting to start posted JSON-RPC serialization, 390.41 µs returning the reply to the network loop, and 31.17 µs for the socket write callback. Each interval is measured separately. Their percentiles cannot be added.

Local validation

  • The starting branch and candidate matched at 84.6% mandatory TCK compatibility across all four sync/async and in-memory/PostgreSQL profiles. Each profile passed 216 executed tests and every mandatory requirement and transport status matched.
  • The standard verify_changes.sh build, test, and full lint checks passed, along with HTTP and gRPC interoperability and the 54-row performance smoke. The signing-enabled test run reproduced the same signing-corpus failure on main. The OSV service returned HTTP 403 for the vendored component scan.

Authorship

The proposed changes were generated by an AI agent.

@MisterVVP MisterVVP added the AI agent AI agent contribution label Nov 20, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP self-assigned this Nov 20, 2026
@MisterVVP MisterVVP added the performance Performance improvement related tasks based on benchmark results. Performance tests changes. label Nov 20, 2026
@MisterVVP
MisterVVP marked this pull request as ready for review November 20, 2026 22:26
@MisterVVP
MisterVVP merged commit 355db35 into perf/grpc-client-streaming Nov 20, 2026
23 checks passed
@MisterVVP
MisterVVP deleted the perf/async-server-transport branch November 20, 2026 22:26
MisterVVP added a commit that referenced this pull request Nov 25, 2026
## Changes

- Optimize async gRPC client streaming and HTTP/JSON + JSON-RPC request
handling.
- Improve async dispatcher scheduling, cancellation, streaming and
response lifecycle handling.
- Include the native HTTP ingress improvements already reviewed in #337
and #338.
- Add targeted tests and performance benchmarks; fix related protocol
compatibility issues.

## Verification

The identical head commit (`355db351f7e1161fdffad55e2f2baf33d8e5fe8a`)
passed the CI, TCK Conformance, CodeQL, Docs, Tutorials and Commit
messages workflows on #334: [CI
#1571](https://github.com/MisterVVP/a2a-cpp/actions/runs/44828943977).

**Policy note:** the diff includes the contributor TCK-gate change from
#338 (100% mandatory compliance → no regression), which should be
reviewed independently of performance improvements.
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.

1 participant