Skip to content

Add Ser/De + roundtrip protocol benchmarks#6776

Merged
RanVaknin merged 7 commits intomasterfrom
rvaknin/isolated-protocol-benchmarks
Mar 31, 2026
Merged

Add Ser/De + roundtrip protocol benchmarks#6776
RanVaknin merged 7 commits intomasterfrom
rvaknin/isolated-protocol-benchmarks

Conversation

@RanVaknin
Copy link
Copy Markdown
Contributor

@RanVaknin RanVaknin commented Mar 11, 2026

Benchmarking notes

  1. Isolated serialization/deserialization — uses the lowest-level public marshalling/unmarshalling API in each SDK. Due to architectural differences between v1 and v2, the deserialization benchmarks have one minor asymmetry worth noting:
    For JSON/RestJson/CBOR deserialization, v2's narrowest unmarshalling entry point takes an SdkHttpFullResponse, so the v2 benchmarks create an SdkHttpFullResponse wrapper per iteration. v1's narrowest entry point takes a raw parser, so it doesn't have this overhead. Even though v2's deserialization benchmark is slightly disadvantaged, it is faster across the board.
Protocol Operation V1 (ops/µs) V2 (ops/µs) Delta
RestJson CreateFunction deser 0.068 0.176 +159%
RestJson CreateFunction ser 0.468 0.284 -39%
JSON DynamoDB PutItem deser 0.072 0.141 +96%
JSON DynamoDB PutItem ser 0.139 0.101 -27%
CBOR CloudWatch GetMetricData deser 0.279 0.382 +37%
CBOR CloudWatch GetMetricData ser 0.719 0.416 -42%
EC2 DescribeInstances deser 0.014 0.019 +36%
EC2 DescribeInstances ser 1.724 1.068 -38%
Query STS AssumeRole deser 0.037 0.038 +3%
Query STS AssumeRole ser 3.181 1.394 -56%
RestXml CloudFront CreateDistribution deser 0.004 0.005 +25%
RestXml CloudFront CreateDistribution ser 0.047 0.079 +68%
  1. Stubbed response roundtrip — full SDK client call through a local Jetty servlet that returns canned responses. Measures the entire request/response pipeline. v1 uses its default HTTP client; V2 uses Apache 5.
Protocol Operation V1 (ops/s) V2 (ops/s) Delta
RestJson Lambda#CreateFunction 6,832 5,502 -19.5%
JSON DDB#PutItem 6,389 5,078 -20.5%
CBOR CW#GetMetricData 6,804 5,487 -19.3%
EC2 EC2#DescribeInstances 4,168 3,717 -10.8%
Query STS#AssumeRole 5,319 4,739 -10.9%
RestXml CF#CreateDistribution 2,034 2,036 +0.1%

@RanVaknin RanVaknin requested a review from a team as a code owner March 11, 2026 06:15
@RanVaknin RanVaknin added changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required labels Mar 11, 2026
@RanVaknin RanVaknin changed the title Add Ser/De protocol benchmarks Add Ser/De + roundtrip protocol benchmarks Mar 17, 2026
@RanVaknin RanVaknin enabled auto-merge March 30, 2026 19:10
Benchmarks for all 6 AWS protocol types measuring serialization and
deserialization in isolation (no HTTP, signing, or retries):

- JSON (DynamoDB PutItem)
- REST-JSON (Lambda CreateFunction)
- REST-XML (CloudFront CreateDistribution)
- Query (STS AssumeRole)
- EC2 (EC2 DescribeInstances)
- CBOR (CloudWatch GetMetricData)

Each protocol has a V1 and V2 benchmark class with @benchmark methods
for both ser and deser, using the same JMH configuration and fixture
data for fair comparison.
@RanVaknin RanVaknin force-pushed the rvaknin/isolated-protocol-benchmarks branch from 0497541 to 9f9c598 Compare March 31, 2026 16:30
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots
7.2% Coverage on New Code (required ≥ 80%)
3.1% Duplication on New Code (required ≤ 3%)
E Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@RanVaknin RanVaknin added this pull request to the merge queue Mar 31, 2026
Merged via the queue into master with commit 2b74e07 Mar 31, 2026
39 of 41 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants