Skip to content

Simple timecheck jsonpath wasm

Changseok Han edited this page Jun 11, 2019 · 4 revisions

Simple time check with dchester/jsonpath

jsonpath is dchester/jsonpath jsonpath-wasm is freestrings/jsonpath's compiled to webassembly

jsonpath-wasm is slow performance on Chrome browser and in NodeJS. not yet usable. :)

Browser Bench Demo

'$..book[?(@.price<30 && @.category=="fiction")]' (loop 2,000)

Chrome: 75.0

Something to wrong in chrome

jsonpath, 177
jsonpath-wasm- selector, 133
jsonpath-wasm- compile, 509
jsonpath-wasm- select, 1050

Firefox: 67.0

jsonpath-wasm is faster than jsonpath

jsonpath, 186
jsonpath-wasm- selector, 86
jsonpath-wasm- compile, 126
jsonpath-wasm- select, 159

NodeJs

  • NodeJS: 11.0

Rust > jsonpath > jsonpath-wasm

select

./bench_wasm.sh

$..book[?(@.price<30 && @.category==fiction)] (loop 100000)

Rust - select: 

real	0m0.594s
user	0m0.594s
sys	0m0.000s

NodeJs - jsonpath - query: 

real	0m5.674s
user	0m6.194s
sys	0m0.037s

NodeJs - jsonpath-wasm - select:

real	0m9.022s
user	0m9.148s
sys	0m0.209s

selector, compile

./bench_wasm.sh extra

$..book[?(@.price<30 && @.category==fiction)] (loop 100000)

Rust - selector: 

real	0m0.520s
user	0m0.520s
sys	0m0.000s

Rust - compile: 

real	0m0.343s
user	0m0.338s
sys	0m0.004s

NodeJs - jsonpath - query: 

real	0m5.937s
user	0m6.415s
sys	0m0.084s

NodeJs - jsonpath-wasm - selector: 

real	0m4.449s
user	0m4.679s
sys	0m0.065s

NodeJs - jsonpath-wasm - compile: 

real	0m7.470s
user	0m7.626s
sys	0m0.168s

NodeJs - jsonpath-wasm - Selector: 

real	0m8.050s
user	0m8.237s
sys	0m0.173s