Skip to content

Commit

Permalink
Benchmark introspecting a schema built from SDL in a supplied file.
Browse files Browse the repository at this point in the history
Use it like so:

```shell
yarn run benchmark
````

Additionally there is a profile command which runs the benchmark with `--prof`:

```shell
yarn run profile
````

Note that on Ubuntu 16.04 this requires:

```shell
sudo apt install linux-tools-common gawk linux-tools-generic linux-tools-4.10.0-35-generic
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
```

On my laptop it produces this:

```
$ yarn run benchmark

> [email protected] benchmark /home/osboxes/graphql-js
> babel-node ./resources/benchmark/run.js

introspectionQuery x 24.59 ops/sec ±3.87% (45 runs sampled)
```
  • Loading branch information
mohawk2 committed Dec 25, 2017
1 parent fd4a69c commit aa8524f
Show file tree
Hide file tree
Showing 4 changed files with 48,129 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"watch": "babel-node ./resources/watch.js",
"cover": "babel-node ./node_modules/.bin/isparta cover --root src --report html _mocha -- $npm_package_options_mocha",
"cover:lcov": "babel-node ./node_modules/.bin/isparta cover --root src --report lcovonly _mocha -- $npm_package_options_mocha",
"benchmark": "babel-node ./resources/benchmark/run.js",
"profile": "perf record -e cycles:u -g -- babel-node --perf-basic-prof ./resources/benchmark/run.js && perf script |./node_modules/stackvis/cmd/stackvis perf >flamegraph.html && echo 'Now view flamegraph.html'",
"preversion": ". ./resources/checkgit.sh && npm test",
"prepublish": ". ./resources/prepublish.sh",
"gitpublish": ". ./resources/gitpublish.sh"
Expand All @@ -56,6 +58,7 @@
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"babel-preset-env": "^1.5.2",
"benchmark": "^2.1.4",
"chai": "4.1.1",
"chai-json-equal": "0.0.1",
"chai-spies-next": "^0.8.0",
Expand All @@ -69,6 +72,7 @@
"isparta": "4.0.0",
"mocha": "3.5.0",
"prettier": "^1.8.2",
"sane": "2.0.0"
"sane": "2.0.0",
"stackvis": "^0.5.0"
}
}
Loading

0 comments on commit aa8524f

Please sign in to comment.