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

Adding daw_json_link to JSON Benchmark #194

Open
Loki-Astari opened this issue Nov 10, 2020 · 15 comments
Open

Adding daw_json_link to JSON Benchmark #194

Loki-Astari opened this issue Nov 10, 2020 · 15 comments
Assignees

Comments

@Loki-Astari
Copy link

JSON Benchmark

If you want to benchmark your code against more JSON libraies:
https://github.com/Loki-Astari/JsonBenchmark

See the section: https://github.com/Loki-Astari/JsonBenchmark#adding-a-new-json-library

@beached
Copy link
Owner

beached commented Nov 11, 2020

looking into it, looks like your library Thor Serializer had to deal with knowing the data type to parse to too via the ActionMap.

@Loki-Astari
Copy link
Author

Loki-Astari commented Nov 11, 2020

Yep. We are probably in the same boat.

Most JSON libraries build their own JSON class hierarchy so their implementation was simpler. I wanted to use normal C++ types; so there was a bit more work to make sure we had the correct mapping.

Your plugin can probably simply take that "ActionMap" straight from my plugin. Then add you just need the implementations of the linked functions.

@beached
Copy link
Owner

beached commented Apr 4, 2021

Tried 3 OS's macos, Ubuntu, and Open Mandriva and get the following or similar error Initializing: fastjson Updated 0 paths from the index scons scons: Reading SConscript files ... TypeError: can't concat str to bytes: File "/path/to/JsonBenchmark/thirdparty/fastjson/SConstruct", line 13: git_sha += "[MOD]" make: *** [Makefile:3: all] Error 2

@Loki-Astari
Copy link
Author

Did you run the "confgure" script?

git clone [email protected]:Loki-Astari/JsonBenchmark.git
cd JsonBenchmark
./configure
make

It's been a while; but it has built on Linux on travis.
https://travis-ci.org/github/Loki-Astari/JsonBenchmark/builds

I am doing a local build.
If that works I will kick of another travis build.

@beached
Copy link
Owner

beached commented Apr 5, 2021

Ah, I was following https://github.com/Loki-Astari/JsonBenchmark#flexibility where it doesn't say that

@beached
Copy link
Owner

beached commented Apr 5, 2021

It was on the init3rdparty step where the error would happen prior to configure

@Loki-Astari
Copy link
Author

I have pushed a fix.

It works on my OSX box.

It is currently building on travis to check Linux versions.
https://travis-ci.org/github/Loki-Astari/JsonBenchmark/builds/765891379

@beached
Copy link
Owner

beached commented Apr 5, 2021

Thanks :)

@Loki-Astari
Copy link
Author

The mac version is not building on travis.
This is because the brew update stalls for 10 minutes rebuilding JAVA.

I don't think this is worth fixing on travis (as it runs on my machine).
I will stop building apple on travis.

Let me know if you get it to work.

@Loki-Astari
Copy link
Author

Did it work?
Can I close the issue?

@beached
Copy link
Owner

beached commented May 30, 2021

So I have an implementation almost ready to go. Just playing around with the tests now. However, it won't work until the next release. Thanks for the issue, I have found a couple bugs and found some nice ways to cleanup the interface to make it easier to use.

Just a note, one hinderance is a few of the other libraries are missing includes, often <stdexcept>, and they use std::runtime_error. This causes a failure to build. Also, the -Werror is catching warnings on the other libraries too.

@beached
Copy link
Owner

beached commented May 31, 2021

Here's the Performance numbers I am seeing

Parse

Library Filename Time (ms) Total
daw_json_link twitter.json 0.957301 5.658911
daw_json_link citm_catalog.json 1.70038  
daw_json_link canada.json 3.00123  
ArduinoJson twitter.json 2.5491 593.26622
ArduinoJson citm_catalog.json 4.12612  
ArduinoJson canada.json 586.591  
cajun-jsonapi twitter.json 25.401 440.4973
cajun-jsonapi citm_catalog.json 75.5873  
cajun-jsonapi canada.json 339.509  
ccan twitter.json 3.13843 28.56962
ccan citm_catalog.json 4.42659  
ccan canada.json 21.0046  
cJSON twitter.json 3.8079 50.91718
cJSON citm_catalog.json 8.68658  
cJSON canada.json 38.4227  
Configuru twitter.json 5.21237 50.86697
Configuru citm_catalog.json 14.0899  
Configuru canada.json 31.5647  
gason twitter.json 3.38871 24.02636
gason citm_catalog.json 8.10165  
gason canada.json 12.536  
jsmn twitter.json 3.54055 398.19975
jsmn citm_catalog.json 13.2292  
jsmn canada.json 381.43  
json-c twitter.json 8.89358 91.09028
json-c citm_catalog.json 18.9776  
json-c canada.json 63.2191  
json-voorhees twitter.json 10.8652 135.9357
json-voorhees citm_catalog.json 29.1091  
json-voorhees canada.json 95.9614  
JsonBox twitter.json 41.7709 384.5155
JsonBox citm_catalog.json 98.7146  
JsonBox canada.json 244.03  
jsoncons twitter.json 5.58334 52.68364
jsoncons citm_catalog.json 10.3005  
jsoncons canada.json 36.7998  
jsoncpp twitter.json 7.07111 130.50441
jsoncpp citm_catalog.json 11.9033  
jsoncpp canada.json 111.53  
jsonxx twitter.json 23.3816 198.7498
jsonxx citm_catalog.json 47.8222  
jsonxx canada.json 127.546  
juson twitter.json 1.41611 27.62336
juson citm_catalog.json 3.63235  
juson canada.json 22.5749  
jvar twitter.json 6.08069 72.49929
jvar citm_catalog.json 15.0152  
jvar canada.json 51.4034  
Jzon twitter.json 13.8037 137.2941
Jzon citm_catalog.json 33.5811  
Jzon canada.json 89.9093  
nlohmann twitter.json 5.6911 58.911
nlohmann citm_catalog.json 11.6623  
nlohmann canada.json 41.5576  
picojson twitter.json 3.47596 45.23558
picojson citm_catalog.json 6.78752  
picojson canada.json 34.9721  
rapidjson twitter.json 1.63997 10.27116
rapidjson citm_catalog.json 2.27521  
rapidjson canada.json 6.35598  
rapidjsonAutoUTF twitter.json 3.98768 18.6373
rapidjsonAutoUTF citm_catalog.json 6.35843  
rapidjsonAutoUTF canada.json 8.29119  
rapidjsonFullPrec twitter.json 1.78861 23.48614
rapidjsonFullPrec citm_catalog.json 2.96613  
rapidjsonFullPrec canada.json 18.7314  
rapidjsonInsitu twitter.json 1.20478 9.84496
rapidjsonInsitu citm_catalog.json 1.78209  
rapidjsonInsitu canada.json 6.85809  
rapidjsonIterative twitter.json 1.75385 10.59083
rapidjsonIterative citm_catalog.json 2.62466  
rapidjsonIterative canada.json 6.21232  
sajson twitter.json 1.33922 11.91554
sajson citm_catalog.json 2.76877  
sajson canada.json 7.80755  
ThorsSerializer twitter.json 11.0079 66.9583
ThorsSerializer citm_catalog.json 12.0784  
ThorsSerializer canada.json 43.872  
udb-jsason-parser twitter.json 5.63392 46.34782
udb-jsason-parser citm_catalog.json 14.2405  
udb-jsason-parser canada.json 26.4734  
vincenthz-libjson twitter.json 5.47252 55.14882
vincenthz-libjson citm_catalog.json 11.6456  
vincenthz-libjson canada.json 38.0307  
yajl twitter.json 4.26781 53.30451
yajl citm_catalog.json 11.3237  
yajl canada.json 37.713  

Stringify

Library Filename Time (ms) Total (ms)
daw_json_link twitter.json 1.33726 9.963291
daw_json_link citm_catalog.json 0.634371  
daw_json_link canada.json 7.99166  
ArduinoJson twitter.json 7.22606 21.90511
ArduinoJson citm_catalog.json 6.35396  
ArduinoJson canada.json 8.32509  
cajun-jsonapi twitter.json 8.53572 147.86452
cajun-jsonapi citm_catalog.json 15.8848  
cajun-jsonapi canada.json 123.444  
ccan twitter.json 3.36601 95.20649
ccan citm_catalog.json 8.86028  
ccan canada.json 82.9802  
cJSON twitter.json 3.7337 185.584
cJSON citm_catalog.json 12.6683  
cJSON canada.json 169.182  
Configuru twitter.json 1.65541 219.33872
Configuru citm_catalog.json 4.38531  
Configuru canada.json 213.298  
gason twitter.json 5.20399 77.95739
gason citm_catalog.json 12.6243  
gason canada.json 60.1291  
json-c twitter.json 2.27976 17.3225
json-c citm_catalog.json 4.30354  
json-c canada.json 10.7392  
json-voorhees twitter.json 9.87166 87.54846
json-voorhees citm_catalog.json 11.6516  
json-voorhees canada.json 66.0252  
JsonBox twitter.json 67.7361 633.0171
JsonBox citm_catalog.json 103.308  
JsonBox canada.json 461.973  
jsoncons twitter.json 2.72254 20.37517
jsoncons citm_catalog.json 3.05683  
jsoncons canada.json 14.5958  
jsoncpp twitter.json 5.08064 129.35233
jsoncpp citm_catalog.json 7.47969  
jsoncpp canada.json 116.792  
jsonxx twitter.json 17.0753 276.1247
jsonxx citm_catalog.json 38.3664  
jsonxx canada.json 220.683  
jvar twitter.json 1.48975 60.73054
jvar citm_catalog.json 4.16389  
jvar canada.json 55.0769  
Jzon twitter.json 3.13496 24.91273
Jzon citm_catalog.json 5.67887  
Jzon canada.json 16.0989  
nlohmann twitter.json 2.37212 20.23124
nlohmann citm_catalog.json 2.59332  
nlohmann canada.json 15.2658  
picojson twitter.json 3.68603 111.39146
picojson citm_catalog.json 9.62533  
picojson canada.json 98.0801  
rapidjson twitter.json 0.845014 11.772384
rapidjson citm_catalog.json 1.29529  
rapidjson canada.json 9.63208  
rapidjsonAutoUTF twitter.json 1.71806 18.08379
rapidjsonAutoUTF citm_catalog.json 2.01263  
rapidjsonAutoUTF canada.json 14.3531  
rapidjsonFullPrec twitter.json 0.846951 11.806371
rapidjsonFullPrec citm_catalog.json 1.29511  
rapidjsonFullPrec canada.json 9.66431  
rapidjsonInsitu twitter.json 1.01676 12.00249
rapidjsonInsitu citm_catalog.json 1.32525  
rapidjsonInsitu canada.json 9.66048  
rapidjsonIterative twitter.json 0.846812 11.781482
rapidjsonIterative citm_catalog.json 1.29211  
rapidjsonIterative canada.json 9.64256  
ThorsSerializer twitter.json 1.99763 64.67426
ThorsSerializer citm_catalog.json 3.53033  
ThorsSerializer canada.json 59.1463  
udb-jsason-parser twitter.json 2.64548 101.89682
udb-jsason-parser citm_catalog.json 3.27714  
udb-jsason-parser canada.json 95.9742  
vincenthz-libjson twitter.json 2.87756 93.31584
vincenthz-libjson citm_catalog.json 3.61468  
vincenthz-libjson canada.json 86.8236  
yajl twitter.json 1.50814 104.54819
yajl citm_catalog.json 3.19205  
yajl canada.json 99.848  

@beached
Copy link
Owner

beached commented May 31, 2021

Should I make a PR once I release v3 ?

@beached beached added this to the v3.0 milestone May 31, 2021
@beached beached self-assigned this May 31, 2021
@Loki-Astari
Copy link
Author

Sorry been distracted.
If you make a PR I will merge.

@beached
Copy link
Owner

beached commented Jun 25, 2021

Will do, i wrote it against develop and will once that hits release for v3

@beached beached removed this from the v3.0 milestone Jun 28, 2022
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

2 participants