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

Cache components, getters and constructors in RecordSerializer #927

Merged
merged 4 commits into from
Dec 23, 2022

Conversation

theigl
Copy link
Collaborator

@theigl theigl commented Dec 2, 2022

This PR adjusts RecordSerializer to cache record components, component getters and the canonical constructor. Thew new implementation is about 20x faster than the current one.

The only downside is that I had to remove the existing no-args constructor. This shouldn't be a huge issue, because there was no need for any user to instantiate the RecordSerializer themselves.

Benchmark Mode Cnt Score Error Units
RecordSerializerBenchmark.new thrpt 4 2215445,525 ± 20885,922 ops/s
RecordSerializerBenchmark.old thrpt 4 105476,509 ± 1699,820 ops/s

If we want to stay fully backwards compatible, we can use ClassValue for caching record components and constructors.

@theigl theigl self-assigned this Dec 2, 2022
@theigl
Copy link
Collaborator Author

theigl commented Dec 16, 2022

@JanecekPetr: One last ping. Do you have any feedback on this implementation? If not, I'm going to merge this next week and release Kryo 5.4.0.

@theigl theigl changed the title [DRAFT] Cache components, getters and constructors in RecordSerializer Cache components, getters and constructors in RecordSerializer Dec 16, 2022
@theigl theigl merged commit 7f789b7 into master Dec 23, 2022
@theigl theigl deleted the caching-record-serializer branch December 23, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant