Skip to content

Migrate client and server SDK JSON parsing to simdjson #311

Closed

Description

@MisterVVP

Problem

The signing path introduced in #308 uses simdjson for strict JSON parsing, while broader SDK parsing still relies on protobuf JSON conversion, intermediate Struct/Value objects, and transport-specific parsing helpers. Migrate the C++ client and server SDK parsing paths to a shared simdjson implementation, preserving protocol behavior and measuring the result.

Scope

  • Inventory JSON parsing in core helpers, Agent Card discovery, HTTP+JSON and JSON-RPC requests/responses/errors, SSE event payloads, and push-notification payloads. Identify which protobuf conversions remain necessary.
  • Introduce shared parsing helpers and migrate the applicable paths incrementally. Avoid introducing simdjson types into public SDK interfaces.
  • Define parser ownership, padded-input handling, buffer/string lifetimes, concurrency, and error mapping. Reuse parsers where safe without a global serialization bottleneck.
  • Preserve protobuf JSON semantics where required: camelCase/snake_case field names, enums, int64 strings, bytes, timestamps, nulls, oneofs, unknown fields, Struct/Value, and numeric precision.
  • Define and test handling of malformed JSON, trailing data, invalid UTF-8, duplicate members, nesting/size limits, and out-of-range numbers. Preserve existing validation and binding-specific errors.
  • Keep signed Agent Card verification on the original JSON, including unknown signed fields. Retain the dedicated RFC 8785 serializer; simdjson does not provide JCS canonicalization.
  • Update CMake targets, exported package dependencies, vcpkg configuration, installation docs and supported platform builds. Decide explicitly how general simdjson use affects builds with signing disabled.
  • Remove superseded parsing code and dependencies once parity is established. JSON serialization changes are outside this issue unless needed for compatibility.

Acceptance criteria

  • A checked-in inventory maps migrated parsing entrypoints and any justified exceptions.
  • Shared unit and integration tests cover valid/invalid requests, responses, errors and streaming payloads through HTTP+JSON, JSON-RPC, and applicable gRPC discovery paths.
  • Compatibility and security fixtures pass, including signed-card vectors and preservation of unknown signed fields.
  • Before/after benchmarks use representative small messages, large task histories/artifacts, Agent Cards and SSE payloads. Report parsing latency, allocations/memory, and relevant end-to-end results; do not infer transport improvements from parser-only benchmarks.
  • Formatting, clean builds, lint, unit/integration tests, dependency scanning, installed-consumer checks and the required upstream TCK flow pass on supported configurations. Report remaining conformance gaps explicitly.

Related work

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. added
    enhancement
    performance
    on Oct 20, 2026
  3. modified the milestones: v0.5.2, v0.6.0 on Oct 20, 2026
  4. moved this from Todo to In Progress in a2a-cpp SDK Roadmapon Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementmaintenanceperformance

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions