Move the logic for building the benchmark/misc/function_call to
the top-level Makefile and use our local copy of node-gyp.
PR-URL: https://github.com/nodejs/node/pull/16160
Fixes: https://github.com/nodejs/node/issues/16154
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
A benchmark for module loading creates a temporary directory in the
benchmark directory. Re-use the test common module to put the tmp
directory in test instead. This was causing intermittent test failures
because run.js (invoked by benchmark tests, mulitple of which could be
running at once) throws if a subdirectory of benchmark disappears at
just the wrong time.
There are other possible solutions than repurposing the `test/common`
module but two arguments for doing it this way are:
* There is already another benchmark file that does this
(`http_server_for_chunky_client.js`) so the dependency already exists
in the benchmarks.
* This also eliminates a re-implementation of rimraf in the benchmark
code.
PR-URL: https://github.com/nodejs/node/pull/16144
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Added parallel test benchmark for es
PR-URL: https://github.com/nodejs/node/pull/16076
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Run only one benchmark for each benchmark file tested by
test-benchmark-misc.js.
PR-URL: https://github.com/nodejs/node/pull/16120
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Modified fs benchmarks to use more unique args to avoid collision.
PR-URL: https://github.com/nodejs/node/pull/16049
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
These v8 benchmarks are oudated and have been replaced by
Octane in the upstream. The benchmarking working group
has already been benchmarking Octane, so this file
can be removed now.
PR-URL: https://github.com/nodejs/node/pull/16126
Ref: https://github.com/nodejs/node/issues/16119
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Make the `http2` module always available.
The `--expose-http2` cli flag is made a non-op
PR-URL: https://github.com/nodejs/node/pull/15535
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The benchmarks for `assert` all take a `method` configuration option,
but the allowable values are different across the files. For each
benchmark, provide an arbitrary default if `method` is set to an empty
string. This allows all the `assert` benchmarks to be run with a single
command but only on a single method. This is primarily useful for
testing that the assert benchmark files don't contain egregious errors.
(In other words, it's useful for testing.)
PR-URL: https://github.com/nodejs/node/pull/15174
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to
a hardcoded index. Calculate the index based on `len` so benchmark can
be run with small `len` values if desired.
PR-URL: https://github.com/nodejs/node/pull/15174
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR #11705 switched Node away from using using OpenSSL's legacy EVP_Sign*
and EVP_Verify* APIs. Instead, it computes a hash normally via
EVP_Digest* and then uses EVP_PKEY_sign and EVP_PKEY_verify to verify
the hash directly. This change corrects two problems:
1. The documentation still recommends the signature algorithm EVP_MD
names of OpenSSL's legacy APIs. OpenSSL has since moved away from
thosee, which is why ECDSA was strangely inconsistent. (This is why
"ecdsa-with-SHA256" was missing.)
2. Node_SignFinal copied some code from EVP_SignFinal's internals. This
is problematic for OpenSSL 1.1.0 and is missing a critical check
that prevents pkey->pkey.ptr from being cast to the wrong type.
To resolve this, remove the non-EVP_PKEY_sign codepath. This codepath is
no longer necessary. PR #11705's verify half was already assuming all
EVP_PKEYs supported EVP_PKEY_sign and EVP_PKEY_verify. Also, in the
documentation, point users towards using hash function names which are
more consisent. This avoids an ECDSA special-case and some strangeness
around RSA-PSS ("RSA-SHA256" is the OpenSSL name of the
sha256WithRSAEncryption OID which is not used for RSA-PSS).
PR-URL: https://github.com/nodejs/node/pull/15024
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Currently the nm_modname does not match the file name of the resulting
module. In fact, the nm_modname is pretty arbitrary. This seeks to
introduce some consistency into the nm_modname property by having the
name of the module appear in exactly one place: the "target_name"
property of the gyp target that builds the module.
PR-URL: https://github.com/nodejs/node/pull/15209
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Set writableStream decodeStrings to false to let the
native layer handle converting strings to buffer.
PR-URL: https://github.com/nodejs/node/pull/15140
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Add default values to use for `type` and `method` in `buffer` benchmarks
when the provided configuration value is an empty string. This is
primarily useful for testing, so the test can request a single iteration
without having to worry about providing different valid values for the
different benchmarks.
While making this change, some `var` instances in immediately
surrounding code were changed to `const`. In some cases, `var` had been
preserved so that the benchmarks would continue to run in versions of
Node.js prior to 4.0.0. However, now that `const` has been introduced
into the benchmark `common` module, the benchmarks will no longer run
with those versions of Node.js anyway.
PR-URL: https://github.com/nodejs/node/pull/15175
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com
The benchmark script for dns contained functions with args declared
but never used. This fix removes those arguments from the function
signatures.
No test existed for the dns benchmark so one was added to the
parallel suite.
To improve performance the tests are limited to 1 invocation to a
single endpoint.
PR-URL: https://github.com/nodejs/node/pull/14936
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.
```console
$ node benchmark/run.js --filter bind-params dgram
dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
throw er; // Unhandled 'error' event
^
Error: bind ENFILE 0.0.0.0
at Object._errnoException (util.js:1041:11)
at _exceptionWithHostPort (util.js:1064:20)
at _handle.lookup (dgram.js:242:18)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:611:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
$
```
PR-URL: https://github.com/nodejs/node/pull/14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
- Make `ExternalString::New` return a `MaybeLocal`. Failing is
left up to the caller.
- Allow creating internalized strings for short header names
to reduce memory consumption and increase performance.
- Use persistent storage for statically allocated header names.
PR-URL: https://github.com/nodejs/node/pull/14808
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.
PR-URL: https://github.com/nodejs/node/pull/12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
The benchmarks had the strict and non strict labels switched.
This is fixed and the benchmarks were extended to check more
possible input types and function calls.
PR-URL: https://github.com/nodejs/node/pull/14147
Refs: https://github.com/nodejs/node/pull/13973
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
* improve util.inspect performance
This is a huge performance improvement in case of sparse arrays
when using util.inspect as the hole will simple be skipped.
* use faster visibleKeys property lookup
* add inspect-array benchmark
PR-URL: https://github.com/nodejs/node/pull/14492
Fixes: https://github.com/nodejs/node/issues/14487
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
By passing a single string rather than many small ones and
a single block allocation for passing headers, save expensive
interactions with JS values and memory allocations.
PR-URL: https://github.com/nodejs/node/pull/14723
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Updates to use current constructor for freelist, which was changed
under pr #12644
Ref: https://github.com/nodejs/node/pull/12644
PR-URL: https://github.com/nodejs/node/pull/14627
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
The benchmarks for `process.nextTick()` do not cover the `default` case
in the internal code's `switch` statement where the callback receives
more than 3 arguments. Modify two of the benchmarks to include this
condition.
PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Functions onOnline and onMessage in benchmark/cluster/echo.js
had unused parameters. They were removed.
PR-URL: https://github.com/nodejs/node/pull/14640
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Functions completeConfig, completeRun, and
updateProgress had unused parameters. These
were removed.
PR-URL: https://github.com/nodejs/node/pull/14526
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Currently most of the event tests only test a single event type,
which might let those benchmark take fast-paths (in V8) that aren't
taken in realistic use cases, and thus the benchmarks are not good
proxies of real world uses.
PR-URL: https://github.com/nodejs/node/pull/14052
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
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>
* 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>