Commit Graph

33 Commits

Author SHA1 Message Date
Ali Hassan
82891ae1a9 benchmark: inherit stdio/stderr instead of pipe
PR-URL: https://github.com/nodejs/node/pull/52456
Fixes: https://github.com/nodejs/node/issues/52233
Refs: https://github.com/nodejs/performance/pull/161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
2024-04-13 18:01:28 +00:00
Ali Hassan
021e172415 benchmark: add ipc support to spawn stdio config
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.

Fixes: https://github.com/nodejs/node/issues/52233
Refs: https://github.com/nodejs/performance/pull/161
PR-URL: https://github.com/nodejs/node/pull/52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
2024-04-13 18:01:28 +00:00
Ali Hassan
47c934e464
benchmark: conditionally use spawn with taskset for cpu pinning
This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: https://github.com/nodejs/node/issues/52233
PR-URL: https://github.com/nodejs/node/pull/52253
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-04-06 22:43:53 +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
Tobias Nießen
9da3f217ef
benchmark: make output RFC 4180 compliant
PR-URL: https://github.com/nodejs/node/pull/37038
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-01-25 07:05:31 -08: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
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
Matheus Marchini
a4e7ea8a3a
benchmark: improve --filter pattern matching
* Let users provide more than one pattern by repeating the flag
  * Add new flag --exclude to exclude patterns
  * Add tests for --filter
  * Document --filter

This commit also fixes a bug where things like
`compare.js --new --old binary --new binary` was acceptable (now the
script will exit and print the usage message).

PR-URL: https://github.com/nodejs/node/pull/29987
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-10 11:34:46 -08: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
29e74d4952 benchmark: refactor for consistent style
Code in benchmark directory sometimes uses `function () {}` for
anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays
sometimes have a trailing comma and sometimes do not. Update to always
use arrow functions for anonymous callbacks and trailing commas for
multiline arrays.

PR-URL: https://github.com/nodejs/node/pull/25944
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-06 22:18:31 -08:00
Ruben Bridgewater
809af1fe8a
benchmark: improve compare output
The current output uses JSON.stringify to escape the config values.
This switches to util.inspect to have a better readable output.

PR-URL: https://github.com/nodejs/node/pull/18597
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-02-08 11:38:25 -05:00
Rich Trott
496f60489d tools,benchmark: use stricter indentation linting
Enable stricter indentation rules for benchmark code.

PR-URL: https://github.com/nodejs/node/pull/13895
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-06-27 06:17:06 -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
Brian White
ccdcd9168a benchmark: improve cli error message
When no matching benchmark files are found, a more sensible error
is shown now.

PR-URL: https://github.com/nodejs/node/pull/12421
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-17 14:48:40 -07:00
Benjamin Fleischer
4897ae2114
benchmark,build,doc,lib,src,test: correct typos
PR-URL: https://github.com/nodejs/node/pull/11189
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-03-03 16:29:19 -05: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
Andreas Madsen
41173de77b benchmark: change the execution order
This changes the execution order from "iter, file, binary" to "file,
iter, binary". This means the csv no longer has to buffered completely.

This also has the added effect that stopping compare.js early or
interfering with performance only affects a single benchmark, instead of
all of them.

Refs: https://github.com/nodejs/node/issues/8659
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:28 -07:00
Adrian Nitu
4b527a4129 benchmark: update compare.js exit method
Node documentation recommends using process.exitCode = x and returning
as a way to exit.

PR-URL: https://github.com/nodejs/node/pull/7961
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2016-08-12 13:23:43 +02:00
Adrian Nitu
9e7fd8e810 benchmark: fix comment typos and code format
I noticed some typos and the lack of {} following an if.

PR-URL: https://github.com/nodejs/node/pull/7961
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2016-08-12 13:23:06 +02:00
Andreas Madsen
855009af7f benchmark: use t-test for comparing node versions
The data sampling is done in node and the data processing is done in R.
Only plyr was added as an R dependency and it is fairly standard.

PR-URL: https://github.com/nodejs/node/pull/7094
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-26 13:21:53 +02:00
Andreas Madsen
0f9bfaa7c5 benchmark: move cli parts of common.js into run.js
It wasn't obviouse that common.js was the main cli tool.

PR-URL: https://github.com/nodejs/node/pull/7094
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-26 12:48:46 +02:00
Rich Trott
1bedeeb41d benchmark: fix lint errors
PR-URL: https://github.com/nodejs/node/pull/5517
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-03-03 09:53:22 -08:00
Rich Trott
76e4a74377 benchmark: refactor to eliminate redeclared vars
In order to comply with linting rules used in the rest of the code base,
eliminate redeclared variables. A conservative approach is used so as to
avoid unintentional performance issues (for example, as might be seen in
some situations when using `let` instead of `var`).

PR-URL: https://github.com/nodejs/node/pull/5468
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-03-01 13:48:42 -08:00
Rich Trott
4bb529d972 benchmark: use strict mode
Apply strict mode to benchmark code.

PR-URL: https://github.com/nodejs/node/pull/5336
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-02-22 11:09:26 -08:00
Brian White
e0730eeaa5 benchmark: allow compare via fine-grained filters
Before this commit, only benchmark targets defined in Makefile could
be used. This commit allows execution of common.js directly and
passing of filter arguments directly, allowing you to run either a
subset of benchmarks or a single specific benchmark for comparison.

PR-URL: https://github.com/iojs/io.js/pull/711
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-02-04 16:55:18 -05:00
Trevor Norris
31314b6978 bench: compare binaries equal times
The benchmark compare would drop the last run of the binary pairs. So
when they were only run once an error would arise because no data was
generated for the second binary.
2013-03-20 20:25:48 +01:00
isaacs
e7b8bad3d9 bench: Do math on numbers in compare.js, not strings 2013-03-07 11:56:53 -08:00
isaacs
db5d58e842 bench: Use environ to run compares more than once
This will run the benchmarks the number of times specified by NODE_BENCH_RUNS,
to attempt to reduce variability.

If the number of runs is high enough, it'll also throw out the top and bottom
quartiles, since that's where the outliers will be.

It's not very fancy statistics-fu, but it's better than nothing.

Also, linted this file.  It had tabs in it.  TABS!
2013-03-06 12:33:05 -08:00
isaacs
053e02ef8e benchmark: Fix alignment issues on --html compare output 2013-02-20 09:17:29 -08:00
isaacs
035aa6b4ce bench: Show % change rather than % difference 2013-02-19 14:14:39 -08:00
isaacs
087c437961 bench: Add --html to compare script 2013-02-19 14:14:38 -08:00
isaacs
aa2edd4b89 bench: A compare script for analyzing benchmarks 2013-02-19 14:14:30 -08:00