Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JSON Query Libraries Comparison
Comparison of various JSON Querying libraries
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Android
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
jsonata
1144.9 Ops/sec
simple
79071.0 Ops/sec
jspath
124350.7 Ops/sec
jmespath
40441.4 Ops/sec
control
127334.4 Ops/sec
jspath+predicates
1139684.9 Ops/sec
HTML Preparation code:
<script type="text/javascript" language="javascript" src="https://cdn.jsdelivr.net/npm/jsonata@1.5.4/jsonata-es5.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdn.jsdelivr.net/npm/jspath@0.4.0/jspath.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jmespath/0.15.0/jmespath.min.js"></script> <script type="text/javascript" language="javascript" src="https://prototype.imin.co/eventseries-sample.js"></script> <script type="text/javascript" language="javascript" src="http://meta.imin.co/v2.js"></script>
Script Preparation code:
var get = p => o => p.reduce((xs, x) => { if (Array.isArray(xs)) { return xs.map(get([x])).filter(y => y !== null).flat(); } else { return (xs && xs[x]) ? xs[x] : null; } }, o); function flattenCollection(collectionIndex) { if (collectionIndex.type === 'imin:CollectionIndex') { return Object.entries(collectionIndex['imin:index']).reduce(function(map, [k, v]) { map[k] = flattenCollection(v); return map; }, {}); } else if (collectionIndex.type === 'imin:Collection') { return collectionIndex['imin:item'].reduce(function(map, item) { map[item.id] = item; return map; }, {}); } else { return collectionIndex; } } var result = { subEvent: [ { offers: [ { acceptedPaymentMethod: [ 'one', 'two', 'three', ], }, { acceptedPaymentMethod: [ 'four', 'five', 'six', ], }, ] }, { offers: [ { acceptedPaymentMethod: [ 'seven', 'eight', 'nine', ], }, { acceptedPaymentMethod: [ 'ten', 'eleven', 'twelve', ], }, ] }, ] };
Tests:
jsonata
var jsonataResult = jsonata('subEvent.offers.acceptedPaymentMethod').evaluate(result).join('<br />');
simple
var simpleResult = get(['subEvent','offers','acceptedPaymentMethod'])(result).join('<br />');
jspath
var jsPathResult = JSPath.apply('.subEvent.offers.acceptedPaymentMethod', result).join('<br />');
jmespath
var jmespathResult = jmespath.search(result, 'subEvent[].offers[].acceptedPaymentMethod[]').join('<br />');
control
result.subEvent.map(s => s.offers.map(o => o.acceptedPaymentMethod)).flat(2).join('<br />')
jspath+predicates
var jsPathResult = JSPath.apply('."imin:aggregateOffer".publicAdult{.price > 0 && .priceCurrency > "."}[-1]', result);