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

Is jsonifier slower than aeson on real-world data? #5

Open
mitchellwrosen opened this issue Jan 5, 2023 · 6 comments
Open

Is jsonifier slower than aeson on real-world data? #5

mitchellwrosen opened this issue Jan 5, 2023 · 6 comments

Comments

@mitchellwrosen
Copy link

In this comment, @KtorZ reports that jsonifier is slower than aeson.

Let's get to the bottom of this! @KtorZ, could you share any benchmarks you have that demonstrate this, or maybe a link to a discussion from some other forum?

@KtorZ
Copy link

KtorZ commented Jan 5, 2023

To give some context, this comment mostly stemmed from empirical measurement and benchmarks using profiling on this project: https://github.com/CardanoSolutions/ogmios -- which has heavy needs on JSON-serialization (hundred of megabytes of data per second).

I originally planned to give jsonifier a try after seeing some blog post / reddit post about it, and as recorded here. I ended up abandoning this decision in favor of aeson's encoding API (see 006) which turned out to be more interoperable and actually faster than jsonifier on the profiling.

What is also absolutely certain is that the default API of aeson (constructing Haskell Value and then serializing) is about twice as slow as encoding JSON directly.

Note also that, this happened 2 years ago. I don't know what's the state of the library today.

@mitchellwrosen
Copy link
Author

Excellent, thanks for the context.

@nikita-volkov
Copy link
Owner

Hey guys! Thanks for the report. Is it possible to narrow this down to a benchmark or a set of benchmarks that highlights the difference?

@KtorZ
Copy link

KtorZ commented Jan 9, 2023

Just to be clear from my end: I am not particularly interested in this conversation / outcome. I've got other matters to tackle and I was merely providing a bit of context.

Best of luck 🍀

@nikita-volkov
Copy link
Owner

@mitchellwrosen So where do we go from here? The specified links only provide vague claims and no way to reproduce. I'm really interested in getting to the bottom of this.

@mitchellwrosen
Copy link
Author

Indeed; I had considered trying to put together a benchmark. I'm sure enormous gobs of "real world" JSON aren't hard to generate or get a hold of.

However, life took over, so I haven't gotten around to doing anything yet.

Feel free to close this issue if you'd like - I may come through with some benchmarks at a later date and re-open if no one else has investigated by then.

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