Skip to content

feat: libraries version update & added jmespath #10

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 68 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The libraries tested are:

| Package | NPM Downloads | Last commit |
| :-- | :-- | :-- |
| [jmespath](https://www.npmjs.com/package/jmespath) | [![npm](https://img.shields.io/npm/dw/jmespath.svg)](https://www.npmjs.com/package/jmespath) | ![GitHub last commit](https://img.shields.io/github/last-commit/jmespath/jmespath.svg) |
| [json-query](https://www.npmjs.com/package/json-query) | [![npm](https://img.shields.io/npm/dw/json-query.svg)](https://www.npmjs.com/package/json-query) | ![GitHub last commit](https://img.shields.io/github/last-commit/mmckegg/json-query.svg) |
| [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) | [![npm](https://img.shields.io/npm/dw/jsonpath-plus.svg)](https://www.npmjs.com/package/jsonpath-plus) | ![GitHub last commit](https://img.shields.io/github/last-commit/s3u/JSONPath.svg) |
| [jsonpath](https://www.npmjs.com/package/jsonpath) | [![npm](https://img.shields.io/npm/dw/jsonpath.svg)](https://www.npmjs.com/package/jsonpath) | ![GitHub last commit](https://img.shields.io/github/last-commit/dchester/jsonpath.svg) |
Expand Down Expand Up @@ -34,79 +35,91 @@ The performance test runs three queries on each of the libraries. All three quer

### Results

Ran using Macbook Pro, 2.2 GHz Intel Core i7, 16 GB 2400 MHz DDR4
Ran using Macbook Pro, 2.9 GHz Quad Core Intel Core i7, 16 GB 2133 MHz LPDDR3

```
$ npm run perf

> [email protected] perf /Users/andrew/Code/scratchwork/perf-json-querying
> [email protected] perf
> node --max-old-space-size=4096 src

smallCityLots 49998 items.
mediumCityLots 99998 items.
largeCityLots 206560 items.

smallCityLots:
- jmespath:
- shallow took 0.0433 seconds.
- deep took 0.0242 seconds.
- conditional took 0.03 seconds.
- json-query:
- shallow took 0.0176 seconds.
- deep took 0.0502 seconds.
- conditional took 0.0408 seconds.
- shallow took 0.0122 seconds.
- deep took 0.0185 seconds.
- conditional took 0.0191 seconds.
- jsonpath-plus:
- shallow took 0.4146 seconds.
- deep took 0.4239 seconds.
- conditional took 0.326 seconds.
- shallow took 0.4074 seconds.
- deep took 0.3992 seconds.
- conditional took 0.1272 seconds.
- jsonpath:
- shallow took 1.1165 seconds.
- deep took 4.4373 seconds.
- conditional took 0.1387 seconds.
- shallow took 1.4419 seconds.
- deep took 10.2739 seconds.
- conditional took 0.0279 seconds.
- JSONStream:
- shallow took 20.5 seconds.
- deep took 23.5372 seconds.
- shallow took 3.2695 seconds.
- deep took 3.4133 seconds.
- oboe:
- shallow took 25.0891 seconds.
- deep took 32.5883 seconds.
- shallow took 4.3055 seconds.
- deep took 4.6955 seconds.
- map-filter-reduce:

mediumCityLots:
- jmespath:
- shallow took 0.0204 seconds.
- deep took 0.0143 seconds.
- conditional took 0.0231 seconds.
- json-query:
- shallow took 0.0489 seconds.
- deep took 0.0732 seconds.
- conditional took 0.0488 seconds.
- shallow took 0.0195 seconds.
- deep took 0.0409 seconds.
- conditional took 0.0322 seconds.
- jsonpath-plus:
- shallow took 0.8285 seconds.
- deep took 0.8567 seconds.
- conditional took 0.6074 seconds.
- shallow took 0.8027 seconds.
- deep took 0.8318 seconds.
- conditional took 0.258 seconds.
- jsonpath:
- shallow took 2.2047 seconds.
- deep took 37.187 seconds.
- conditional took 0.2852 seconds.
- shallow took 3.0419 seconds.
- deep took 39.8507 seconds.
- conditional took 0.054 seconds.
- JSONStream:
- shallow took 199.4793 seconds.
- deep took 5.0332 seconds.
- shallow took 6.4748 seconds.
- deep took 7.1143 seconds.
- oboe:
- shallow took 27.819 seconds.
- deep took 77.9259 seconds.
- shallow took 9.0225 seconds.
- deep took 9.037 seconds.
- map-filter-reduce:

largeCityLots:
- jmespath:
- shallow took 0.0185 seconds.
- deep took 0.0325 seconds.
- conditional took 0.0453 seconds.
- json-query:
json-query shallow failed, RangeError: Maximum call stack size exceeded.
json-query deep failed, RangeError: Maximum call stack size exceeded.
json-query conditional failed, RangeError: Maximum call stack size exceeded.
- jsonpath-plus:
- shallow took 2.3345 seconds.
- deep took 2.472 seconds.
- conditional took 3.1351 seconds.
- shallow took 2.1476 seconds.
- deep took 2.2733 seconds.
- conditional took 0.5042 seconds.
- jsonpath:
- shallow took 8.509 seconds.
- deep took 252.9623 seconds.
- conditional took 0.7586 seconds.
- shallow took 8.8206 seconds.
- deep took 165.9704 seconds.
- conditional took 0.1196 seconds.
- JSONStream:
- shallow took 54.8295 seconds.
- deep took 146.2962 seconds.
- shallow took 19.1526 seconds.
- deep took 19.69 seconds.
- oboe:
- shallow took 148.8824 seconds.
- deep took 216.7555 seconds.
- shallow took 26.6115 seconds.
- deep took 28.8616 seconds.
- map-filter-reduce:


Expand All @@ -117,33 +130,36 @@ smallCityLots
┌───────────────────┬───────────────────┬───────────────────┬───────────────────┐
│ (index) │ shallow │ deep │ conditional │
├───────────────────┼───────────────────┼───────────────────┼───────────────────┤
│ json-query │ 0.0176 │ 0.0502 │ 0.0408 │
│ jsonpath-plus │ 0.4146 │ 0.4239 │ 0.326 │
│ jsonpath │ 1.1165 │ 4.4373 │ 0.1387 │
│ JSONStream │ 20.5 │ 23.5372 │ 'not possible' │
│ oboe │ 25.0891 │ 32.5883 │ 'not possible' │
│ jmespath │ 0.0433 │ 0.0242 │ 0.03 │
│ json-query │ 0.0122 │ 0.0185 │ 0.0191 │
│ jsonpath-plus │ 0.4074 │ 0.3992 │ 0.1272 │
│ jsonpath │ 1.4419 │ 10.2739 │ 0.0279 │
│ JSONStream │ 3.2695 │ 3.4133 │ 'not possible' │
│ oboe │ 4.3055 │ 4.6955 │ 'not possible' │
│ map-filter-reduce │ 'not implemented' │ 'not implemented' │ 'not implemented' │
└───────────────────┴───────────────────┴───────────────────┴───────────────────┘
mediumCityLots
┌───────────────────┬───────────────────┬───────────────────┬───────────────────┐
│ (index) │ shallow │ deep │ conditional │
├───────────────────┼───────────────────┼───────────────────┼───────────────────┤
│ json-query │ 0.0489 │ 0.0732 │ 0.0488 │
│ jsonpath-plus │ 0.8285 │ 0.8567 │ 0.6074 │
│ jsonpath │ 2.2047 │ 37.187 │ 0.2852 │
│ JSONStream │ 199.4793 │ 5.0332 │ 'not possible' │
│ oboe │ 27.819 │ 77.9259 │ 'not possible' │
│ jmespath │ 0.0204 │ 0.0143 │ 0.0231 │
│ json-query │ 0.0195 │ 0.0409 │ 0.0322 │
│ jsonpath-plus │ 0.8027 │ 0.8318 │ 0.258 │
│ jsonpath │ 3.0419 │ 39.8507 │ 0.054 │
│ JSONStream │ 6.4748 │ 7.1143 │ 'not possible' │
│ oboe │ 9.0225 │ 9.037 │ 'not possible' │
│ map-filter-reduce │ 'not implemented' │ 'not implemented' │ 'not implemented' │
└───────────────────┴───────────────────┴───────────────────┴───────────────────┘
largeCityLots
┌───────────────────┬───────────────────┬───────────────────┬───────────────────┐
│ (index) │ shallow │ deep │ conditional │
├───────────────────┼───────────────────┼───────────────────┼───────────────────┤
│ jmespath │ 0.0185 │ 0.0325 │ 0.0453 │
│ json-query │ 'failed' │ 'failed' │ 'failed' │
│ jsonpath-plus │ 2.3345 2.4723.1351
│ jsonpath │ 8.509252.9623 │ 0.7586
│ JSONStream │ 54.8295146.2962 │ 'not possible' │
│ oboe │ 148.8824216.7555 │ 'not possible' │
│ jsonpath-plus │ 2.14762.27330.5042
│ jsonpath │ 8.8206165.9704 │ 0.1196
│ JSONStream │ 19.1526 19.69 │ 'not possible' │
│ oboe │ 26.6115 28.8616 │ 'not possible' │
│ map-filter-reduce │ 'not implemented' │ 'not implemented' │ 'not implemented' │
└───────────────────┴───────────────────┴───────────────────┴───────────────────┘
```
Loading