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

Replace json11 with RapidJSON #3

Open
kaskavalci opened this issue Mar 30, 2016 · 9 comments
Open

Replace json11 with RapidJSON #3

kaskavalci opened this issue Mar 30, 2016 · 9 comments
Assignees
Milestone

Comments

@kaskavalci
Copy link

Hi,

I've read rationales.md but couldn't find a reference why using json11. When I check their repo I notice that they don't have active development, pull requests from 2014 linger there and dropbox/json11#41 seems like they have performance issues. We like to use ppconsul but json11 from the benchmarks seems unreliable. I wanted to ask you if you had any reasons to choose json11? Thanks.

@oliora
Copy link
Owner

oliora commented Mar 30, 2016

Hi,

There was only one reason for json11 library: a simple and convenient C++ API. Btw, that project was more alive at the time I've started to use it. Now it's really not improving. And true, its performance sucks comparing to RapidJSON and other highly optimized JSON libraries.
I've already thought about switching to another JSON library but there was other more important things to do and also nobody complained about json11. So now is the time to switch :)
I need to finish adding of HTTPS support for ppconsul then I can get rid of json11 in favor of a better alternative like RapidJSON or some other with comparable performance and quality.

@oliora oliora self-assigned this Mar 30, 2016
@oliora oliora added this to the 0.1 milestone Mar 30, 2016
@zapbranighan
Copy link

For HTTPS support have you looked at the Requests C++ library:
https://github.com/whoshuu/cpr

I found a good description of it here:
https://www.youtube.com/watch?v=f_D-wD1EmWk

@lamduy-nguyen
Copy link

lamduy-nguyen commented Nov 28, 2018

rapidjson is a hot C++ json library at this moment.

It's worth taking a look at

@oliora oliora changed the title Design decision - use of json11 Replace json11 with RapidJSON May 12, 2020
@oliora oliora modified the milestones: 0.1, 0.3 May 12, 2020
@indev29
Copy link
Contributor

indev29 commented Oct 13, 2020

I suggest using nlohmann/json instead. It's more modern, still maintained and pretty much as fast as rapidjson now.

@oliora
Copy link
Owner

oliora commented Oct 13, 2020

As I know, nlohmann is much slower: https://github.com/miloyip/nativejson-benchmark and it does not support stream writing (correct me if I’m wrong), which means that user has always create an intermediate DOM (json object for nlohmann) and then serialize it to string. RapidJSON is also mucho better battle tested. So I think ppconsul should use rapidjson.

@oliora
Copy link
Owner

oliora commented Oct 13, 2020

Have you seen boost.json? It seems that it has a good performance and also quite modern,

@indev29
Copy link
Contributor

indev29 commented Oct 13, 2020

Never used it myself nor have I seen it being used in other projects. Rapidjson/nlohmann feels like an industry standard at this point with the first used for more speed and the second for more convenience and readability. Oh, and there is also a json parser in boost.property_tree (i guess boost.json is another thing).

@oliora
Copy link
Owner

oliora commented Oct 13, 2020

The json parser in property tree is a joke. unsuitable for anything serious.

@zhoub
Copy link

zhoub commented Jan 14, 2023

The json parser in property tree is a joke. unsuitable for anything serious.

Absolutely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants