Skip to content

perf(streaming): add build-private subscription phase diagnostics - #237

Merged
MisterVVP merged 4 commits into
dev-optimize-streaming-response-latenciesfrom
dev-investigate-and-optimize-subscription-completion-path
Sep 2, 2026
Merged

MisterVVP merged 4 commits into
dev-optimize-streaming-response-latenciesfrom
dev-investigate-and-optimize-subscription-completion-path

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Motivation

The HTTP+JSON and JSON-RPC subscription paths now achieve very low first-event latency, but high-concurrency terminal/completion throughput still needs phase-level attribution.

Add internal profiling diagnostics that can be enabled for optimized performance investigations without exposing diagnostics through the public SDK or shipping the instrumentation in normal builds.

Changes

  • Add build-private subscription phase diagnostics behind A2A_ENABLE_SUBSCRIPTION_DIAGNOSTICS, OFF by default.
  • Keep diagnostics implementation and headers internal to the repository rather than the installed SDK API.
  • Compile instrumentation into SDK targets only for explicitly enabled testing/performance builds.
  • Retain A2A_SUBSCRIPTION_DIAGNOSTICS=1 as the runtime collection switch inside an instrumentation-enabled build.
  • Measure clearly named server phases including total cancel execution, terminal store update, terminal publication, subscriber resume, serialization, framing, and HTTP delivery.
  • Measure client terminal observer and completion callback execution separately.
  • Emit server and client diagnostic snapshots independently because the wire benchmark client and TCK SUT run in separate processes.
  • Extend the performance runner to collect the two diagnostic streams separately.
  • Add tests for diagnostic aggregation/reporting and verify that normal SDK builds contain no subscription-diagnostics symbols or diagnostic environment-variable tokens.
  • Preserve the existing coroutine subscription architecture, shared libcurl reactor, bounded callback dispatch, and public APIs.

@MisterVVP MisterVVP added the codex Automatic label added by codex agent. Should not be used label Sep 1, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP self-assigned this Sep 1, 2026
@MisterVVP MisterVVP added AI agent AI agent contribution performance Performance improvement related tasks based on benchmark results. Performance tests changes. and removed codex Automatic label added by codex agent. Should not be used labels Sep 1, 2026
@MisterVVP

Copy link
Copy Markdown
Owner Author

TODO: compile diagnostics out of normal SDK builds

@MisterVVP MisterVVP changed the title perf(streaming): attribute subscription terminal phases perf(streaming): add build-private subscription phase diagnostics Sep 2, 2026
@MisterVVP
MisterVVP marked this pull request as ready for review September 2, 2026 10:11
@MisterVVP
MisterVVP merged commit 4e670b0 into dev-optimize-streaming-response-latencies Sep 2, 2026
19 checks passed
@MisterVVP
MisterVVP deleted the dev-investigate-and-optimize-subscription-completion-path branch September 2, 2026 10:11
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