Skip to content

STATIC_MODE seems to be SLOWER then DYNAMIC_MODE #197

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

Open
mburger81 opened this issue Jul 19, 2018 · 4 comments
Open

STATIC_MODE seems to be SLOWER then DYNAMIC_MODE #197

mburger81 opened this issue Jul 19, 2018 · 4 comments

Comments

@mburger81
Copy link

Hey, we tested your demo example in java and doing some benchmark tests, with your example it seems the STATIC_MODE which should be the fastest mode is much more slower then the DYNAMIC_MODE.

If we loop it thorugh 10000+ times we se a bug performance difference.

Also we noticed your documentation seems on some buggy.

@taowen
Copy link
Contributor

taowen commented Jul 20, 2018

can you provide a benchmark to reproduce?

@mburger81
Copy link
Author

I created a new repo https://github.com/mburger81/jsoniter-test where I have invited you to be a collaborator.

I tested this scenario where I created a new Pojo class and serialize it 1000000 times

This is my benchmark result

without setMode: 1856 -> this should be same es reflection right?
Reflection: 1846ms
DynamicMode: 1285ms
StaticMode: 1224ms

As you can see in this case it seems the static mode is the fastest one, nearly the same as dynamic mode. I have the big problem we have to serialize json on a embeded system and nee much performance as possible. On another test on another project we did before, the static mode was slower it could be we did something wrong there. Having a look there seems to be a -30% comparing to reflection, is that what we can expect?

@patrushev
Copy link

I confirm making similar observation. We ran some comparison tests and found that STATIC mode is somewhat slower than DYNAMIC. The warmup is definitely much slower for STATIC. Quite strange results.

@taowen
Copy link
Contributor

taowen commented Mar 18, 2019 via email

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

No branches or pull requests

3 participants