Commit Graph

81 Commits

Author SHA1 Message Date
Aviv Keller
71785889c8
lib: prefer logical assignment
PR-URL: https://github.com/nodejs/node/pull/55044
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2024-10-09 06:42:16 +00:00
Giovanni Bucci
03fe00e3da
benchmark: adds groups to better separate benchmarks
Fixes: https://github.com/nodejs/node/issues/26425
Co-Authored-By: Yaman Kassir <mestery@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/54393
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-09-04 03:26:53 +00:00
Sankalp Shubham
9f3aacbc27
url: add value argument to has and delete methods
The change aims to add value argument to two methods of URLSearchParams
class i.e the has method and the delete method. For has method, if
value argument is provided, then use it to check for presence. For
delete method, if value argument provided, use it to delete.

Fixes: https://github.com/nodejs/node/issues/47883
PR-URL: https://github.com/nodejs/node/pull/47885
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-05-14 14:35:19 +00:00
Moshe Atlow
9658d84ddd tools: fix jsdoc lint
PR-URL: https://github.com/nodejs/node/pull/47789
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2023-05-02 00:48:20 +00:00
Antoine du Hamel
ca5f322d32
benchmark: add trailing commas
PR-URL: https://github.com/nodejs/node/pull/46370
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-01-29 19:13:35 +01:00
Brian White
1a8d340792 benchmark: introduce benchmark combination filtering
PR-URL: https://github.com/nodejs/node/pull/45735
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-01-22 07:45:21 +00:00
Joyee Cheung
2b9d3b2755
benchmark: make benchmarks runnable in older versions of Node.js
Also remove the require-cachable.js benchmarks because now all builtin
modules are cacheable, it would be comparing oranges to apples when
we try to compare the performance of loading all cacheable modules
in different Node.js binaries since the set of modules are just
different. Comparison of startup performance that involves loading
of the long-standing, stable builtins is already covered by the
require-builtins benchmark.

PR-URL: https://github.com/nodejs/node/pull/45746
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-12-08 14:50:18 +00:00
Brian White
adef64ce63 benchmark: fix output regression
Fixes: https://github.com/nodejs/node/issues/43628

PR-URL: https://github.com/nodejs/node/pull/43635
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-07-08 15:47:35 +02:00
Paolo Insogna
d636fee319 benchmark: fix fork detection
PR-URL: https://github.com/nodejs/node/pull/43601
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-06-29 08:36:20 +02:00
Paolo Insogna
684e107965 benchmark: forcefully close processes
PR-URL: https://github.com/nodejs/node/pull/43557
Fixes: https://github.com/nodejs/build/issues/2968
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-06-27 12:29:47 +02:00
Rich Trott
0018ee1f68
benchmark: replace hasOwnProperty() with Object.hasOwn()
PR-URL: https://github.com/nodejs/node/pull/41724
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-01-30 06:36:19 +00:00
Rich Trott
cf6996458b
benchmark,test: use Object.hasOwn() where applicable
Refs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn

PR-URL: https://github.com/nodejs/node/pull/41229
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-12-20 04:03:58 +00:00
Michaël Zasso
2a1dea8a22
benchmark: output JSON-compatible numbers
This is to simplify the implementation of a JavaScript version of the
compare.R script.

PR-URL: https://github.com/nodejs/node/pull/38778
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-05-25 13:36:47 -07:00
Antoine du Hamel
0c879cb7b8 benchmark: avoid using console.log()
PR-URL: https://github.com/nodejs/node/pull/38370
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-04-27 12:28:30 +02:00
Antoine du Hamel
4e9ad206e2
benchmark: use process.hrtime.bigint()
PR-URL: https://github.com/nodejs/node/pull/38369
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-26 11:44:23 -07:00
Joyee Cheung
dbcadf005e
benchmark: make the benchmark tool work with Node 10
Avoid using class fields in the benchmark tools since they are
not available in Node 10. This can be reverted when Node 10
reaches EOL.

PR-URL: https://github.com/nodejs/node/pull/35817
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2020-11-04 10:40:14 +08:00
Daniele Belardi
e18f5af270
benchmark: use let instead of var in common.js
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:12 +02:00
Ruben Bridgewater
1760c23f75
benchmark: add test and all options and improve errors"
This reverts commit 4671d551cf and
contains a fix to the issue raised for the revert.

PR-URL: https://github.com/nodejs/node/pull/31755
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-03-09 22:35:53 +01:00
Ruben Bridgewater
f64aafa2d5
benchmark: refactor helper into a class
This reverts commit 5b0308cd82.

PR-URL: https://github.com/nodejs/node/pull/31755
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-03-09 22:35:53 +01:00
Anna Henningsen
5b0308cd82
Revert "benchmark: refactor helper into a class"
This reverts commit b70741ea43.

Refs: https://github.com/nodejs/node/pull/31396
PR-URL: https://github.com/nodejs/node/pull/31722
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-02-10 22:35:37 +01:00
Anna Henningsen
4671d551cf
Revert "benchmark: add test and all options and improve errors"
This reverts commit dac579516c.

Refs: https://github.com/nodejs/node/pull/31396
PR-URL: https://github.com/nodejs/node/pull/31722
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-02-10 22:35:35 +01:00
Ruben Bridgewater
dac579516c
benchmark: add test and all options and improve errors
This adds a new `test` option. Using it automatically uses a single
minimal option matrix to verify the benchmark works as expected.

Using the new `all` option makes sure all test suites are run.

On top of that the benchmarks will from now on report properly
what category might have a typo, if any.

The http duration was also refactored to use a option instead of
relying on a configuration setting.

The fixture folder is ignored as test suite from now on.

PR-URL: https://github.com/nodejs/node/pull/31396
Fixes: https://github.com/nodejs/node/issues/31083
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-09 13:31:45 +01:00
Ruben Bridgewater
b70741ea43
benchmark: refactor helper into a class
This is the basis to refactor the helper to use modern class
language features such as private fields.

It also refactors the exports to use module.exports. That way it's
immediately clear what parts are exported.

PR-URL: https://github.com/nodejs/node/pull/31396
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-09 13:31:38 +01:00
Brian White
b862a0c6d6
benchmark: check for and fix multiple end()
PR-URL: https://github.com/nodejs/node/pull/31624
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-08 21:36:31 -05:00
Brian White
fd8d44f644 benchmark: allow easy passing of process flags
PR-URL: https://github.com/nodejs/node/pull/28986
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-08-07 19:33:17 -07:00
Ruben Bridgewater
b08a867d60
benchmark,doc,lib: capitalize more comments
PR-URL: https://github.com/nodejs/node/pull/26849
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-27 17:20:06 +01:00
ZYSzys
b4e670dc26 benchmark: remove unreachable return
PR-URL: https://github.com/nodejs/node/pull/25883
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-07 13:21:33 +01:00
Rich Trott
7c9fba30ef benchmark: refactor benchmark/common.js
Refactor benchmark/common.js to consistently use arrow functions for
anonymous callbacks and trailing commas.

PR-URL: https://github.com/nodejs/node/pull/25805
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-31 20:46:54 -08:00
Ruben Bridgewater
1f85ea979c
tools: capitalize sentences
This adds the `capitalized-comments` eslint rule to verify that
actual sentences use capital letters as starting letters. It ignores
special words and all lines below 62 characters.

PR-URL: https://github.com/nodejs/node/pull/24808
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-12-10 17:07:18 +01:00
Joyee Cheung
a365bb9cb1
benchmark: pre-generate data set for URL benchmarks
This patch:

- Introduces `common.bakeUrlData` which can be used to pre-generate
  the data set for the URL benchmarks to loop through instead of
  looping over a constant.
- Add the option to use WPT data in benchmarks for better diversity
  in the input
- Add the option to benchmark URL parsing with base URLs (whatwg only)
- Moves the data in `benchmark/fixtures/url-inputs.js` to
  `benchmark/common.js`

PR-URL: https://github.com/nodejs/node/pull/24302
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-20 05:14:34 +08:00
Daniel Bevenius
ce6ec368a6 build: use BUILDTYPE in bench-addons-build targets
This commit uses the BUILDTYPE for the benchmark targets that currently
explicitly use Release as the build type.

The motivation for this change is allows switching between debug builds
and release builds using the bench-addons-clean/bench-addons-build
targets.

PR-URL: https://github.com/nodejs/node/pull/24033
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-11 12:09:25 -05:00
cjihrig
ff8db70bc2
benchmark: add common.binding()
Recently, process.binding() was replaced with internalBinding().
However, internalBinding() is not available on older builds of
Node, which are often used for benchmarking purposes. This commit
adds a common.binding() to the benchmarks to work around the
issue. Hopefully, this can be removed in the not too distant
future.

PR-URL: https://github.com/nodejs/node/pull/23460
Fixes: https://github.com/nodejs/node/issues/23436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-10-14 13:23:16 -04:00
Vse Mozhet Byt
b9457717ca benchmark: remove needless RegExp capturing
Use non-capturing grouping or remove capturing completely when:

* capturing is useless per se, e.g. in test() check;
* captured groups are not used afterwards at all;
* some of the later captured groups are not used afterwards.

PR-URL: https://github.com/nodejs/node/pull/13718
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-06-19 18:06:17 +03:00
Vse Mozhet Byt
8beff64851 benchmark: fix some RegExp nits
* Take RegExp creation out of cycle.
* use test(), not match() in boolean context.

PR-URL: https://github.com/nodejs/node/pull/13551
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-06-12 12:10:22 +03:00
Rich Trott
c3067b5640 benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

PR-URL: https://github.com/nodejs/node/pull/13110
Fixes: https://github.com/nodejs/node/issues/13102
Fixes: https://github.com/nodejs/node/issues/12433
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-05-21 20:05:13 -07:00
Rich Trott
a82e0e6f36 benchmark: check for time precision in common.js
Some benchmark tests are failing intermittently, possibly due to
hrtime() imprecision on particular hosts. This change will confirm or
refute that as the root cause the next time the test fails on CI. Either
way, it's a valid check.

PR-URL: https://github.com/nodejs/node/pull/12934
Ref: https://github.com/nodejs/node/issues/12497
Ref: https://github.com/nodejs/node/issues/12433
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-11 16:20:19 -07:00
Vse Mozhet Byt
22aa3d4899 benchmark: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12455
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-20 04:46:37 +03:00
Vse Mozhet Byt
bbbb1f6078 benchmark: fix CLI arguments check in common.js
PR-URL: https://github.com/nodejs/node/pull/12429
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-20 03:34:13 +03:00
James M Snell
0227571c17 Revert "benchmark: fix CLI arguments check in common.js"
This reverts commit e34f8e1444.

PR-URL: https://github.com/nodejs/node/pull/12474
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-17 15:50:20 -07:00
Vse Mozhet Byt
e34f8e1444 benchmark: fix CLI arguments check in common.js
PR-URL: https://github.com/nodejs/node/pull/12429
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-17 14:36:36 -07:00
Vse Mozhet Byt
642baf4699 benchmark: check end() argument to be > 0
PR-URL: https://github.com/nodejs/node/pull/12030
Ref: https://github.com/nodejs/node/issues/11972
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-03-28 03:18:44 +03:00
Nikolai Vavilov
43fa0a8847 benchmark: allow multiple values for same config
This allows running a benchmark with two or more values for the same
config rather than just one or all of them, for example:

```
node benchmark/buffers/buffer-creation.js type=buffer() type=fast-alloc type=fast-alloc-fill
```

PR-URL: https://github.com/nodejs/node/pull/11819
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-03-22 19:41:24 +02:00
Bartosz Sosnowski
75cdc895ec benchmark: cleanup after forced optimization drop
This removes all instances of %OptimizeFunctionOnNextCall from common.js
and README.md

PR-URL: https://github.com/nodejs/node/pull/9615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-03-06 16:32:06 +01:00
Joyee Cheung
60d77bd514 benchmark: add progress indicator to compare.js
* Print the progress bar and the current benchmark to stderr
  when stderr is TTY and stdout is not.
* Allow cli arguments without values via setting.boolArgs
* Add --no-progress option

PR-URL: https://github.com/nodejs/node/pull/10823
Fixes: https://github.com/nodejs/node/issues/8659
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2017-01-31 03:03:57 +08:00
Brian White
7889416b8a
benchmark: keep decimals in results
Some benchmarks' results are small values, so keeping decimals when
running them manually (not comparing) can be helpful.

PR-URL: https://github.com/nodejs/node/pull/10559
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-05 02:48:07 -05:00
Joyee Cheung
2826e6324c benchmark: allow benchmarks to specify flags
* Give createBenchmark and the Benchmark constructor
  a third argument for specifying the command line flags
  that this benchmark should be run with.
  The benchmarks are no longer run with --expose-internals
  by default, they will need to explicitly pass the flags.
* Rename options to configs in createBenchmark and the Benchmark
  constructor to match the documentation since they are not optional.
* Comment the properties of a Benchmark object

Also improve the documentation about creating benchmarks

* Add detailed description of the arguments of `createBenchmark`
* Describe the two passes of running the benchmarks
* Suggest what kind of code should go where in the benchmark example

PR-URL: https://github.com/nodejs/node/pull/10448
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-04 22:45:34 +08:00
Brian White
17eb8fce05 benchmark: use commas in non-csv rate output
PR-URL: https://github.com/nodejs/node/pull/10360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-23 23:22:59 -08:00
Andreas Madsen
8a0b7ffac6 benchmark: use node v4 syntax in common.js
Using new syntax such as `...args` means that the benchmark suite can't
be used with older node versions. This changes the `...args` syntax to a
good old `Array.prototype.slice`.

Refs: https://github.com/nodejs/node/pull/8932#issuecomment-252924107
PR-URL: https://github.com/nodejs/node/pull/9064
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-10-17 08:57:34 -07:00
Bartosz Sosnowski
99a2dd03cd benchmark: add --expose_internals switch
Adds --expose_internals switch to benchmark runner. This makes
misc/freelist.js benchmark run properly

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/8547
2016-09-26 17:23:48 +02:00
Bartosz Sosnowski
b1bbc68fb1 benchmark: support for multiple http benchmarkers
This adds support for multiple HTTP benchmarkers. Adds autocannon
as the secondary benchmarker.

PR-URL: https://github.com/nodejs/node/pull/8140
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-08-31 17:49:26 +02:00