nativejson-benchmark icon indicating copy to clipboard operation
nativejson-benchmark copied to clipboard

Add more JSON libaries

Open miloyip opened this issue 9 years ago • 31 comments

Above released in v1.0.0


miloyip avatar Apr 16 '15 03:04 miloyip

sajson was added in https://github.com/miloyip/nativejson-benchmark/tree/sajson branch but it is unable to parse twitter.json. Reported as https://github.com/chadaustin/sajson/issues/7.


Confirmed it is fixed.

miloyip avatar Apr 17 '15 13:04 miloyip

JSON Voorhees fails to compile on 32-bit target. Reported as https://github.com/tgockel/json-voorhees/issues/53.

miloyip avatar Apr 17 '15 17:04 miloyip

ArduinoJson was added in https://github.com/miloyip/nativejson-benchmark/tree/ArduinoJson branch. But it cannot parse properly due to stack overflow. Reported as https://github.com/bblanchon/ArduinoJson/issues/65.


Confirmed it is fixed.

miloyip avatar Apr 18 '15 01:04 miloyip

nbsdx/SimpleJSON was added but there seems no way to iterate object and array. Reported as https://github.com/nbsdx/SimpleJSON/issues/1.


Update:The functions were added. And statistics has been completed.

miloyip avatar Apr 19 '15 04:04 miloyip

jbson seems not working widely:

Requires codecvt header (C++11, missing in gcc-4.8 & gcc-4.9 stdlib), various template aliases (C++14), probably more where gcc's stdlib is behind on the standard. Known only to work with an up-to-date libc++ currently.

Thus not add it at this moment.

miloyip avatar Apr 19 '15 05:04 miloyip

ArduinoJson crashes when printing big number in conformance test. Reported as https://github.com/bblanchon/ArduinoJson/issues/67.

miloyip avatar Apr 22 '15 14:04 miloyip

@miloyip as a notice the Nlohmann/json has released v1.0.0, 16 days ago and would be worth to update. (Crossref: https://github.com/nlohmann/json/issues/177)

xor-gate avatar Jan 12 '16 21:01 xor-gate

@miloyip hello, I want to find a pure C, easy to use and intergrated json library, I found these:

  • https://github.com/sheredom/json.h
  • https://github.com/vurtun/mmx/blob/master/mm_json.h

maybe these can be added into benchmark, I found libraries here, Thanks for these good results :-)

starwing avatar Jan 13 '16 07:01 starwing

Homepage: http://zserge.com/jsmn.html Code: https://github.com/zserge/jsmn

FEATURES
  • simple
  • highly portable (tested on x86/amd64, ARM, AVR)
  • compatible with C89
  • no dependencies (even libc!)
  • no dynamic memory allocation
  • extremely small code footprint - it’s just about 200 LOC
  • API has only 2 functions
  • incremental single-pass parsing
  • library code is covered with tests

js_perf

denji avatar Jan 18 '16 15:01 denji

@miloyip, thanks for updating nlohmann/json to 1.0.0. Is there a way to have a look at the new results?

nlohmann avatar Jan 20 '16 21:01 nlohmann

@nlohmann I will rerun the benchmarks after adding a few more libraries. You may also run it locally as well.

miloyip avatar Jan 21 '16 01:01 miloyip

@miloyip is there no way to automate running the benchmarks with continues integration. E.g Travis CI ?

xor-gate avatar Jan 21 '16 08:01 xor-gate

@xor-gate Ideally of course that will be the best. However, do you know any free service can provide stable performance environment? Travis does not guarantee what build machine will be used, and how many concurrent builds (other users) will be running.

miloyip avatar Jan 21 '16 09:01 miloyip

You are right about that, I have overseen this. But a colleague tried to run the tests but he could not get it to work. Maybe a alternative would be to have the test suite executable automatically build under Docker. With a Dockerfile supplied, e.g Debian Jessie as base image then people can easy reproduce binaries and run on real metal.

xor-gate avatar Jan 21 '16 09:01 xor-gate

I understand there is difficult to build and run the tests. I faced these problems often as well. The docker idea seems interesting. I have not tried docker before, not sure if there is potential problems. Ideally the dockerfile is built in CI to make it always up-to-date. If you can help on trying this it will be great.

miloyip avatar Jan 21 '16 09:01 miloyip

@miloyip I will open a separate issue for this so we when I need some help we can discus there. I will give it a shot this weekend.

xor-gate avatar Jan 21 '16 09:01 xor-gate

@starwing json.h done

miloyip avatar Jan 22 '16 18:01 miloyip

@starwing There are some issues when integrating MMX https://github.com/vurtun/mmx/issues/3

miloyip avatar Jan 23 '16 09:01 miloyip

@starwing Sigh... the author of mmx has removed the mm_json.h. I think I have not provoked him anyway https://github.com/vurtun/mmx/issues/3

miloyip avatar Jan 24 '16 02:01 miloyip

malloc() we can wrap jemalloc, scalloc, hoard (LD_PRELOAD) [1] [2]

denji avatar Jan 24 '16 12:01 denji

Hey @miloyip, today I released version 1.1.0 of JSON for Modern C++. It would be great if you could update it in your benchmark.

This release also fixes some bugs that have been detected with your floating-point tests. :-)

nlohmann avatar Jan 24 '16 21:01 nlohmann

@nlohmann It's done. BTW, I just added a FAQ for updating libraries. Welcome for updating it via pull request. Good to know this test has helped improving your library :smile:

miloyip avatar Jan 25 '16 01:01 miloyip

@miloyip so sad things :(

But still very thank you for the work!!

starwing avatar Jan 26 '16 02:01 starwing

@miloyip do you think FlatBuffers may have a place in your benchmark ?

StephaneG31 avatar Dec 16 '16 12:12 StephaneG31

In my opinion, this is a different format (just like MessagePack, Protocol Buffers, BSON) and should not be added to the nativejson-benchmark. As the name contains ... json.

xor-gate avatar Dec 16 '16 12:12 xor-gate

@xor-gate FlatBuffers can Parse JSON so maybe in some part of the benchmark this lib may be compared to the others

StephaneG31 avatar Dec 16 '16 12:12 StephaneG31

That make sense, I was not aware of that.

xor-gate avatar Dec 16 '16 12:12 xor-gate

Please add js0n.

user1095108 avatar Jun 16 '18 14:06 user1095108

Please add zzzJSON

tkokof avatar Sep 06 '18 02:09 tkokof

Related requests #113 (simdjson) and #118 (Boost/Beast JSON)

mloskot avatar Sep 23 '19 09:09 mloskot

@miloyip, please add yyjson. This one seems to be the fastest json lib (faster than simdjson for large json files I process in my project)

pps83 avatar Jun 06 '22 12:06 pps83