perf: tighten smithy serde hot paths (1/3) - #359
Draft
jterapin wants to merge 1 commit into
Draft
Conversation
Consolidates the JSON, XML, and CBOR serde optimizations plus the smithy-schema extension helpers they share. - Cache list/map member and wire-name lookups on hot paths - Reuse Builder and Parser instances within codecs - Avoid coercion and helper indirection in union/structure handling - Align JSON and CBOR parser lookups with schema metadata - Honor protocol default timestamp behavior across serde - Lazily buffer XML parser text chunks; cache flattened trait lookups - Move sparse? and related helpers from ExtensionHelpers into Extension - Focus serde specs on behavior
This was referenced Sep 3, 2026
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.
Part 1 of 3 splitting #358.
Summary
Consolidates JSON, XML, and CBOR serde optimizations plus the smithy-schema extension helpers they share.
Changes
sparse?and related helpers fromExtensionHelpersintoExtensionBenchmarks
Paired V3-vs-V4 serde runs on graviton and intel: ~26% faster than V3 at the median, zero regressions on either architecture.
Per-protocol delta vs V3 (graviton, all rows are wins):
Stack
Validation
bundle exec rspecper gem: smithy-schema (161), smithy-json (78), smithy-xml (67), smithy-cbor (265), smithy-client (897, 2 pending). All pass.