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

message: Fix benchmark read reuse test #580

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

matheusd
Copy link
Contributor

No description provided.

This shows that the BenchmarkUnmarshal_Reuse is broken.
Previously, this benchmark was using the Reset() method to reset the
message's arena, which can't be done for reading, as the recently
introduced comments indicate.

This fixes the benchmark by releasing the previous arena and directly
modifying the arena field of the message.

In the future, this should be done explicitly by either Reset() or by a
new dedicated function.
This adds comments to the Marshal/Unmarshal benchmarks to make it clear
their goals and caveats.

It also splits the marshalling benchmark into two: one with and one
without message reuse.
@lthibault lthibault merged commit 1d667cd into capnproto:main Aug 6, 2024
0 of 4 checks passed
@matheusd matheusd deleted the fix-reuse-test branch August 7, 2024 10:05
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