Skip to content

test(benchmark): add msgpack serialization/deserialization to benchmark #2242

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

Merged
merged 6 commits into from
May 19, 2025

Conversation

Kn0688
Copy link
Contributor

@Kn0688 Kn0688 commented May 16, 2025

ObjectType must be MEDIA_CONTENT or SAMPLE.

What does this PR do?

add msgpack serialization/deserialization to benchmark

Related issues

no

Does this PR introduce any user-facing change?

no

Benchmark

@Kn0688 Kn0688 requested a review from chaokunyang as a code owner May 16, 2025 10:45
import org.apache.fury.benchmark.state.ObjectType;
import org.apache.fury.benchmark.state.ProtoBuffersState;
import org.apache.fury.benchmark.state.ProtostuffState;
import org.apache.fury.benchmark.state.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use mvn spotless:apply to format code? if it doesn't optimize imports, change it manualy

we do not use * for import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have already used mvn spotless:apply to format code.But It is an IDE issue. I'll fix it.
image

return mediaContent;
}

private static void packMedia(MessagePacker messagePacker, Media media) throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an automatic way to serialize it ? This is basically a manually-written serializer. We are benchmarking with the serializer you written instead of msgpack itself. We only use the msgpack protocol

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no automatic way, maybe we could add some comments in this class and the benchmark readme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The msgpack's official provides msgpack-jackson lib, but the performance is relatively poor. So, generate a basic handwritten code using qwen3(LLM). Then modify it.

Below is a performance comparison.
g2

@chaokunyang chaokunyang merged commit 9560076 into apache:main May 19, 2025
50 checks passed
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