Skip to content

Remove schema_stack field from SchemaAwareWriteSerializer - #163

Merged
martin-g merged 3 commits into
apache:mainfrom
jdarais:jd-feat-serde-perf
Mar 17, 2025
Merged

martin-g merged 3 commits into
apache:mainfrom
jdarais:jd-feat-serde-perf

Conversation

@jdarais

@jdarais jdarais commented Mar 17, 2025

Copy link
Copy Markdown
Contributor

This is a follow-up from my last PR: SchemaAwareWriteSerializer doesn't need the schema_stack field since it can make use of the call stack to track which schema it's currently using. Making this switch makes the schema tracking a bit more consistent, whereas before, sometimes the schema_stack was used, and sometimes a new SchemaAwareWriteSerializer as created. This switch also improves performance slightly, particularly when the serializer encounters union or reference values.

Changes in this PR:

  • Remove schema_stack field in favor of serialize_*_with_schema member functions
  • Benchmark tests updated to include some union fields to measure performance of serialize_*_with_schema logic
  • Rename support classes to match SchemaAwareWriteSerializer

@martin-g
martin-g merged commit c1c595a into apache:main Mar 17, 2025
@martin-g

Copy link
Copy Markdown
Member

Thank you, @jdarais !

thynson added a commit to thynson/avro-rs that referenced this pull request Apr 9, 2025
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.

2 participants