Conversation
adwsingh
marked this pull request as draft
September 7, 2026 19:39
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 7, 2026 20:13
fd3bddb to
7570e75
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
2 times, most recently
from
September 7, 2026 21:11
32e16fe to
5e1f35a
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 7, 2026 21:21
5e1f35a to
7bff019
Compare
adwsingh
changed the base branch from
adwsingh/runtime-codegen-serde-common
to
adwsingh/runtime-codegen-serde-http-binding
September 7, 2026 21:25
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 7, 2026 22:59
7bff019 to
574f406
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 7, 2026 23:06
574f406 to
b020581
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 7, 2026 23:15
b020581 to
42c958b
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 8, 2026 00:10
42c958b to
028dc06
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 8, 2026 10:56
028dc06 to
dafc3e1
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
2 times, most recently
from
September 8, 2026 15:11
2817e78 to
f2040a9
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 8, 2026 18:46
f2040a9 to
e5547df
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
3 times, most recently
from
September 9, 2026 00:28
a5fe3f1 to
157af5c
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 00:42
157af5c to
87f08fc
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 00:50
87f08fc to
701e0a6
Compare
adwsingh
marked this pull request as ready for review
September 9, 2026 00:55
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 10:55
701e0a6 to
9232969
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 11:27
9232969 to
0f00c7d
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 11:28
0f00c7d to
97d45c1
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 12:18
97d45c1 to
701e0a6
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 18:50
701e0a6 to
3dd70b7
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 9, 2026 19:55
3dd70b7 to
ef51fe6
Compare
adwsingh
force-pushed
the
adwsingh/runtime-codegen-serde-json
branch
from
September 10, 2026 18:02
ef51fe6 to
6bba6d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What behavior changes?
JsonCodeccan now generate per-shape serializers and deserializers as bytecode at runtime. Generation is opt-in viaJsonCodec.builder().runtimeCodegen(true)or thesmithy-java.runtime-codegen/smithy-java.runtime-codegen.jsonsystem property, and requires JDK 25+. Default behavior is unchanged.enabledfalls back transparently to the dispatch serde, andstrictthrows instead of falling back. The property and a builder's explicit setting combine by severity:disabledon either side wins, thenstrictescalates. The property is therefore both the default for codecs that set nothing and an operational kill switch for codecs that opted in through code.MemberSubsetCodecbridging on both the serialize and deserialize sides, so the HTTP binding's member-subset body path is covered in addition to full-struct codecs.implementation={generic,generated}param that A/Bs this same production path throughRestJsonClientProtocolandAwsJson1Protocol(run with-Pjmh.implementation=generic,generated).Why is this change needed?
Performance. The dispatch serde pays per-member schema dispatch through megamorphic call sites, repeated member-name handling, and intermediate allocation on every operation. A generated program per shape is straight-line, monomorphic code with pre-encoded field-name bytes. The CPU-efficiency gains run ahead of the latency gains because lower allocation also cuts GC work per operation.
How was this validated?
DifferentialRuntimeCodegenJsonFuzzTest: the generated and interpreted codecs produce byte-identical output and fail on identical inputs across the fuzz corpus. The codegen arm runs in strict mode, so a silent fallback fails the fuzz instead of quietly comparing dispatch against dispatch.RuntimeJsonCodegenTestandRuntimeCodecRegistryTest: generation across shape types, caching, strict semantics, and property handling.RuntimeCodegenStrictCoverageTest: every benchmark case drives the real client protocols under strict mode, so a backend change that stops generating for a benchmark shape fails CI rather than silently skewing a benchmark run.Benchmark Results
Summary
restJson1 deserialization
restJson1 serialization
awsJson1.0 deserialization
awsJson1.0 serialization
What should reviewers focus on?
enabledmust never change observable behavior, andstrictmust never silently fall back.JsonRuntimeCodegenBackend: how each shape type is lowered, and where it declines.MemberSubsetCodecbridging in both directions, which is what lets restJson1 bodies use generated programs.Additional Links
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.