Skip to content

enhancement(http): add schema-cached HTTP binding serde - #793

Draft
stobrien89 wants to merge 1 commit into
smithy-lang:developfrom
stobrien89:enhancement-http-binding-serde
Draft

enhancement(http): add schema-cached HTTP binding serde#793
stobrien89 wants to merge 1 commit into
smithy-lang:developfrom
stobrien89:enhancement-http-binding-serde

Conversation

@stobrien89

Copy link
Copy Markdown

Description

Adds schema-cached HTTP binding serialization and deserialization.

Changes

  • Adds generic SchemaExtension support to smithy-core.
  • Adds HTTPBindingSchemaInfo for cached HTTP binding metadata.
  • Adds HTTPBindingSerializer, driven directly by generated serialize_members().
  • Optimizes the existing HTTPResponseDeserializer using ordered cached bindings.
  • Preserves the legacy serialize() path for handwritten inputs.
  • Fixes computed response Content-Length handling.
  • Requires no code generation changes.

Performance

On an x86 (m7i) benchmark instance, Rest JSON p50 improved by:

  • Serialization: 49.7%
  • Deserialization: 45.2%
  • Overall: 47.5%

Before:

Rest JSON 1
  serialization 
    restJson1_CopyObjectRequest_Baseline                       n=10000  p50=33.94 us
    restJson1_CopyObjectRequest_M                              n=10000  p50=109.66 us
    restJson1_PutObject_S                                      n=10000  p50=38.72 us
    restJson1_PutObject_M                                      n=10000  p50=39.35 us
    restJson1_PutObject_L                                      n=10000  p50=38.91 us
  deserialization 
    restJson1_CopyObjectOutput_Baseline                        n=10000  p50=24.52 us
    restJson1_CopyObjectOutput_M                               n=10000  p50=68.39 us
    restJson1_GetObject_S                                      n=10000  p50=56.43 us
    restJson1_GetObject_M                                      n=10000  p50=57.17 us
    restJson1_GetObject_L                                      n=10000  p50=56.82 us

After:

Rest JSON 1
  serialization
    restJson1_CopyObjectRequest_Baseline                       n=10000  p50=13.85 us
    restJson1_CopyObjectRequest_M                              n=10000  p50=87.23 us
    restJson1_PutObject_S                                      n=10000  p50=17.89 us
    restJson1_PutObject_M                                      n=10000  p50=18.18 us
    restJson1_PutObject_L                                      n=10000  p50=18.06 us
  deserialization 
    restJson1_CopyObjectOutput_Baseline                        n=10000  p50=12.26 us
    restJson1_CopyObjectOutput_M                               n=10000  p50=51.71 us
    restJson1_GetObject_S                                      n=10000  p50=29.00 us
    restJson1_GetObject_M                                      n=10000  p50=28.33 us
    restJson1_GetObject_L                                      n=10000  p50=29.05 us

Each case used 5,000 warmup and 10,000 measured iterations.

Compatibility

  • Existing HTTPRequestSerializer usage remains supported.
  • Inputs implementing only serialize() use the compatibility fallback.
  • Response consumer ordering is preserved.
  • Document codecs continue receiving the original schema.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant