• Home
  • Raw
  • Download

Lines Matching full:js

1 # How to Write and Run Benchmarks in Node.js Core
12 * [Comparing Node.js versions](#comparing-nodejs-versions)
30 `Autocannon` is a Node.js script that can be installed using
31 `npm install -g autocannon`. It will use the Node.js executable that is in the
33 Node.js version in the path is not altered.
42 `node benchmark/run.js --set benchmarker=autocannon http`
44 `node benchmark/http/simple.js benchmarker=autocannon`
52 `node benchmark/http2/simple.js benchmarker=autocannon`
93 $ node benchmark/buffers/buffer-tostring.js
95 buffers/buffer-tostring.js n=10000000 len=0 arg=true: 62710590.393305704
96 buffers/buffer-tostring.js n=10000000 len=1 arg=true: 9178624.591787899
97 buffers/buffer-tostring.js n=10000000 len=64 arg=true: 7658962.8891432695
98 buffers/buffer-tostring.js n=10000000 len=1024 arg=true: 4136904.4060201733
99 buffers/buffer-tostring.js n=10000000 len=0 arg=false: 22974354.231509723
100 buffers/buffer-tostring.js n=10000000 len=1 arg=false: 11485945.656765845
101 buffers/buffer-tostring.js n=10000000 len=64 arg=false: 8718280.70650129
102 buffers/buffer-tostring.js n=10000000 len=1024 arg=false: 4103857.0726124765
115 $ node benchmark/buffers/buffer-tostring.js len=1024
117 buffers/buffer-tostring.js n=10000000 len=1024 arg=true: 3498295.68561504
118 buffers/buffer-tostring.js n=10000000 len=1024 arg=false: 3783071.1678948295
124 by using the `run.js` tool. To see how to use this script,
125 run `node benchmark/run.js`. Again this does not provide the statistical
129 $ node benchmark/run.js assert
131 assert/deepequal-buffer.js
132 assert/deepequal-buffer.js method="deepEqual" strict=0 len=100 n=20000: 773,200.4995493788
133 assert/deepequal-buffer.js method="notDeepEqual" strict=0 len=100 n=20000: 964,411.712953848
136 assert/deepequal-map.js
137 assert/deepequal-map.js method="deepEqual_primitiveOnly" strict=0 len=500 n=500: 20,445.06368453332
138 assert/deepequal-map.js method="deepEqual_objectOnly" strict=0 len=500 n=500: 1,393.3481642240833
141 assert/deepequal-object.js
142 assert/deepequal-object.js method="deepEqual" strict=0 size=100 n=5000: 1,053.1950937538475
143 assert/deepequal-object.js method="notDeepEqual" strict=0 size=100 n=5000: 9,734.193251965213
150 $ node benchmark/run.js assert async_hooks
155 `benchmark/run.js` and `benchmark/compare.js` have `--filter pattern` and
160 $ node benchmark/run.js --filter "deepequal-b" assert
162 assert/deepequal-buffer.js
163 assert/deepequal-buffer.js method="deepEqual" strict=0 len=100 n=20000: 773,200.4995493788
164 assert/deepequal-buffer.js method="notDeepEqual" strict=0 len=100 n=20000: 964,411.712953848
166 $ node benchmark/run.js --exclude "deepequal-b" assert
168 assert/deepequal-map.js
169 assert/deepequal-map.js method="deepEqual_primitiveOnly" strict=0 len=500 n=500: 20,445.06368453332
170 assert/deepequal-map.js method="deepEqual_objectOnly" strict=0 len=500 n=500: 1,393.3481642240833
173 assert/deepequal-object.js
174 assert/deepequal-object.js method="deepEqual" strict=0 size=100 n=5000: 1,053.1950937538475
175 assert/deepequal-object.js method="notDeepEqual" strict=0 size=100 n=5000: 9,734.193251965213
182 $ node benchmark/run.js --filter "deepequal-b" --filter "deepequal-m" assert
184 assert/deepequal-buffer.js
185 assert/deepequal-buffer.js method="deepEqual" strict=0 len=100 n=20000: 773,200.4995493788
186 assert/deepequal-buffer.js method="notDeepEqual" strict=0 len=100 n=20000: 964,411.712953848
188 assert/deepequal-map.js
189 assert/deepequal-map.js method="deepEqual_primitiveOnly" strict=0 len=500 n=500: 20,445.06368453332
190 assert/deepequal-map.js method="deepEqual_objectOnly" strict=0 len=500 n=500: 1,393.3481642240833
192 $ node benchmark/run.js --exclude "deepequal-b" --exclude "deepequal-m" assert
194 assert/deepequal-object.js
195 assert/deepequal-object.js method="deepEqual" strict=0 size=100 n=5000: 1,053.1950937538475
196 assert/deepequal-object.js method="notDeepEqual" strict=0 size=100 n=5000: 9,734.193251965213
199 assert/deepequal-prims-and-objs-big-array-set.js
200 assert/deepequal-prims-and-objs-big-array-set.js method="deepEqual_Array" strict=0 len=20000 n=25 p…
201 assert/deepequal-prims-and-objs-big-array-set.js method="notDeepEqual_Array" strict=0 len=20000 n=2…
202 assert/deepequal-prims-and-objs-big-array-set.js method="deepEqual_Set" strict=0 len=20000 n=25 pri…
210 $ node benchmark/run.js --filter "bench-" process
212 process/bench-env.js
213 process/bench-env.js operation="get" n=1000000: 2,356,946.0770617095
214 process/bench-env.js operation="set" n=1000000: 1,295,176.3266261867
215 process/bench-env.js operation="enumerate" n=1000000: 24,592.32231990992
216 process/bench-env.js operation="query" n=1000000: 3,625,787.2150573144
217 process/bench-env.js operation="delete" n=1000000: 1,521,131.5742806569
219 process/bench-hrtime.js
220 process/bench-hrtime.js type="raw" n=1000000: 13,178,002.113936031
221 process/bench-hrtime.js type="diff" n=1000000: 11,585,435.712423025
222 process/bench-hrtime.js type="bigint" n=1000000: 13,342,884.703919787
224 $ node benchmark/run.js --filter "bench-" --exclude "hrtime" process
226 process/bench-env.js
227 process/bench-env.js operation="get" n=1000000: 2,356,946.0770617095
228 process/bench-env.js operation="set" n=1000000: 1,295,176.3266261867
229 process/bench-env.js operation="enumerate" n=1000000: 24,592.32231990992
230 process/bench-env.js operation="query" n=1000000: 3,625,787.2150573144
231 process/bench-env.js operation="delete" n=1000000: 1,521,131.5742806569
234 ### Comparing Node.js versions
236 To compare the effect of a new Node.js version use the `compare.js` tool. This
239 run `node benchmark/compare.js`.
246 First build two versions of Node.js, one from the master branch (here called
263 The `compare.js` tool will then produce a csv file with the benchmark results.
266 $ node benchmark/compare.js --old ./node-master --new ./node-pr-5134 string_decoder > compare-pr-51…
269 *Tips: there are some useful options of `benchmark/compare.js`. For example,
288 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=128 encoding='ascii' …
289 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=128 encoding='utf8' …
290 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=32 encoding='ascii' …
291 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=32 encoding='base64-ascii' …
328 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=128 encoding='ascii' *** …
329 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=32 encoding='ascii' *** …
330 …string_decoder/string-decoder.js n=2500000 chunkLen=16 inLen=4096 encoding='ascii' *** …
331 …string_decoder/string-decoder.js n=2500000 chunkLen=256 inLen=1024 encoding='ascii' *** …
342 To do this use the `scatter.js` tool, this will run a benchmark multiple times
344 run `node benchmark/scatter.js`.
347 $ node benchmark/scatter.js benchmark/string_decoder/string-decoder.js > scatter.csv
420 the CI, check out [How to: Running core benchmarks on Node.js CI][benchmark-ci].
426 All benchmarks use the `require('../common.js')` module. This contains the
464 ```js
466 const common = require('../common.js');
515 ```js
518 const common = require('../common.js');