Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize schema type info for some common types #233

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

brantburnett
Copy link
Contributor

Motivation

For common types like numbers and strings we're allocating more YardarmTypeInfo objects on the heap than necessary. We'd also like to get more clarity when a given type requires dynamic serialization as this may require additional support by serialization libraries.

Modifications

  • For string and number types use shared static instances of YardarmTypeInfo
  • Obsolete the NullSchemaGenerator and replace with the DynamicSchemaGenerator which tracks it's parent element. This allows serialization extenions to recognize if the schema requires certain types of serialization support based on where it's located.
  • Add RequiresDynamicSerialization to YardarmTypeInfo and set to true for the DynamicSchemaGenerator

Motivation
----------
For common types like numbers and strings we're allocating more
YardarmTypeInfo objects on the heap than necessary. We'd also like to
get more clarity when a given type requires dynamic serialization as
this may require additional support by serialization libraries.

Modifications
-------------
- For string and number types use shared static instances of
  YardarmTypeInfo
- Obsolete the NullSchemaGenerator and replace with the
  DynamicSchemaGenerator which tracks it's parent element. This allows
  serialization extenions to recognize if the schema requires certain
  types of serialization support based on where it's located.
- Add RequiresDynamicSerialization to YardarmTypeInfo and set to true
  for the DynamicSchemaGenerator
@brantburnett
Copy link
Contributor Author

/merge

@centeredgebot centeredgebot bot merged commit ef17ee0 into main Apr 28, 2024
5 checks passed
@centeredgebot centeredgebot bot deleted the schema-type-info branch April 28, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant