luizperes / simdjson_nodejs

Node.js bindings for the simdjson project: "Parsing gigabytes of JSON per second"
https://arxiv.org/abs/1902.08318
Apache License 2.0
549 stars 25 forks source link

Update to simdjson v0.4.7 #41

Closed ChrisSmith closed 4 years ago

ChrisSmith commented 4 years ago

This updates simdjson to v0.4.7 Fixes https://github.com/luizperes/simdjson_nodejs/issues/37

To pull the files

wget https://raw.githubusercontent.com/simdjson/simdjson/v0.4.7/singleheader/simdjson.h https://raw.githubusercontent.com/simdjson/simdjson/v0.4.7/singleheader/simdjson.cpp

Baseline (using isValid)

node --version 
v12.18.3

cat /proc/cpuinfo | grep "model name"
Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
filename filesize (MB) JSON.parse(ms) simdjson.lazyParse (ms) JSON.parse (GB/s) simdjson.lazyParse (GB/s) X faster
apache_builds.json 0.13 0.321 0.077 0.40 1.66 4.19
canada.json 2.25 15.917 3.210 0.14 0.70 4.96
citm_catalog.json 1.73 3.688 3.288 0.47 0.53 1.12
github_events.json 0.07 0.150 0.047 0.43 1.37 3.15
gsoc_2018.json 3.33 6.368 2.316 0.52 1.44 2.75
instruments.json 0.22 0.512 0.149 0.43 1.48 3.44
marine_ik.json 2.98 15.029 4.557 0.20 0.65 3.30
mesh_pretty.json 1.58 4.561 1.621 0.35 0.97 2.81
mesh.json 0.72 3.503 1.049 0.21 0.69 3.34
numbers.json 0.15 0.713 0.176 0.21 0.85 4.05
random.json 0.51 2.146 1.174 0.24 0.43 1.83
sf_citylots.json 189.78 1581.782 567.806 0.12 0.33 2.79
twitter.json 0.63 1.800 1.187 0.35 0.53 1.52
twitterescaped.json 0.56 2.146 0.612 0.26 0.92 3.51
update_center.json 0.53 2.519 1.022 0.21 0.52 2.47

`

After Update (using isValid)

filename filesize (MB) JSON.parse(ms) simdjson.lazyParse (ms) JSON.parse (GB/s) simdjson.lazyParse (GB/s) X faster
apache_builds.json 0.13 0.321 0.076 0.40 1.68 4.24
canada.json 2.25 15.607 3.413 0.14 0.66 4.57
citm_catalog.json 1.73 3.679 3.267 0.47 0.53 1.13
github_events.json 0.07 0.150 0.046 0.43 1.41 3.25
gsoc_2018.json 3.33 6.368 2.365 0.52 1.41 2.69
instruments.json 0.22 0.512 0.141 0.43 1.56 3.62
marine_ik.json 2.98 15.021 4.439 0.20 0.67 3.38
mesh_pretty.json 1.58 4.558 1.602 0.35 0.98 2.85
mesh.json 0.72 3.500 0.967 0.21 0.75 3.62
numbers.json 0.15 0.711 0.179 0.21 0.84 3.97
random.json 0.51 2.134 1.170 0.24 0.44 1.82
sf_citylots.json 189.78 1626.302 571.143 0.12 0.33 2.85
twitter.json 0.63 1.815 1.179 0.35 0.54 1.54
twitterescaped.json 0.56 2.149 0.604 0.26 0.93 3.56
update_center.json 0.53 2.609 1.016 0.20 0.52 2.57
luizperes commented 4 years ago

Thanks for your pull request, @ChrisSmith! Will publish a new version soon.