Skip to content

perf: Reduce the size of Error from 256 bytes to 88 bytes - #194

Merged
martin-g merged 1 commit into
apache:mainfrom
Kriskras99:fix/reduce_error_size
May 15, 2025
Merged

martin-g merged 1 commit into
apache:mainfrom
Kriskras99:fix/reduce_error_size

Conversation

@Kriskras99

Copy link
Copy Markdown
Contributor

Enums are the size of their largest variants and Schema is a very large type. This also means that every AvroResult is also at least as big as the Error type.

Enums are the size of their largest variants and Schema is a very
large type. This also means that every AvroResult is also at least
as big as the Error type.

By Boxing the Schema, the size is reduced from `size_of::<Schema>() == 176`
to `size_of::<Box<Schema>>() == 8`.
@martin-g martin-g changed the title fix: Reduce the size of Error from 256 bytes to 88 bytes perf: Reduce the size of Error from 256 bytes to 88 bytes May 15, 2025
@martin-g
martin-g merged commit 066bd92 into apache:main May 15, 2025
@martin-g

Copy link
Copy Markdown
Member

Thank you, @Kriskras99 !

@Kriskras99
Kriskras99 deleted the fix/reduce_error_size branch May 15, 2025 18:10
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