Skip to content

Add Ser/De protocol benchmarks#6776

Open
RanVaknin wants to merge 3 commits intomasterfrom
rvaknin/isolated-protocol-benchmarks
Open

Add Ser/De protocol benchmarks#6776
RanVaknin wants to merge 3 commits intomasterfrom
rvaknin/isolated-protocol-benchmarks

Conversation

@RanVaknin
Copy link
Contributor

@RanVaknin RanVaknin commented Mar 11, 2026

Benchmarking notes

These benchmarks isolate the serialization/deserialization layer by attempting to use the lowest level public marshalling/unmarshalling layer 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.

Throughput

Protocol Operation V1 (ops/µs) V2 (ops/µs) Diff
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%

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 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
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.5% Coverage on New Code (required ≥ 80%)
3.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

1 participant