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

Performance bottleneck at RecordNaming #151

Closed
twinprime opened this issue Jul 25, 2023 · 7 comments · Fixed by #190 or #202
Closed

Performance bottleneck at RecordNaming #151

twinprime opened this issue Jul 25, 2023 · 7 comments · Fixed by #190 or #202
Labels
enhancement New feature or request
Milestone

Comments

@twinprime
Copy link

Hi, I am not sure if this is a known problem.

I was doing a simple benchmark of Avro4k and discovered that when Unions are involved, e.g. a sealed interface, a lot of CPU time (like 30% for my case) is spent on RecordNaming.invoke(String, List<Annotation>, NamingStrategy). I used VisualVM to verify.

This is one of the thing that makes Avro4K much slower than jackson-dataformat-avro. Its 2-3x slower for my test case.

@Chuckame
Copy link
Contributor

Chuckame commented Jul 25, 2023

Thanks for the benchmark. Can you put at least a screenshot of visualvm of CPU Time tab, or at most the file ? Also with source showing the benchmark if possible

We know that there is still reflection that could be replaced, and a lot of re-computation on some cases.

@twinprime
Copy link
Author

No problem, I uploaded the src and a screen shot here

https://github.com/twinprime/avro-benchmark

@Chuckame
Copy link
Contributor

Thanks. I'll try to fix this

@Chuckame
Copy link
Contributor

I'm currently working on #148 that should improve the performances, I'll let you informed

@Chuckame Chuckame added the enhancement New feature or request label Aug 28, 2023
@thake thake added this to the Version 2 milestone Jan 21, 2024
@thake
Copy link
Member

thake commented Jan 21, 2024

A huge performance improvement is planned for version 2. See #160 (comment)

@Chuckame
Copy link
Contributor

Chuckame commented May 3, 2024

Duplicate of #199

@Chuckame Chuckame marked this as a duplicate of #199 May 3, 2024
@Chuckame Chuckame closed this as completed May 3, 2024
@Chuckame
Copy link
Contributor

Chuckame commented May 9, 2024

FYI @twinprime I just move your project to avro4k to allow us benchmarking easily for the next releases, thanks for the codebase. See #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants