`util.getCallSite` returns an array of call site objects. Rename the
function to reflect that it returns a given count of frames captured
as an array of call site object.
Renames the first parameter `frames` to be `frameCount` to indicate
that it specifies the count of returned call sites.
PR-URL: https://github.com/nodejs/node/pull/55626
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
- Increase the number of iteration to 1e6 to reduce flakes. 1e4
can introduce flakes even when comparing the main branch
against itself
- Replace the 1024 * 32 length test with 1024 * 8 since it would
otherwise take too long to complete. Remove the 16 length test
since it's not too different from 32.
- Check the results of the encoding methods at the end.
PR-URL: https://github.com/nodejs/node/pull/46658
Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45803
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/45450
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This reverts commit 7cfbc9f90f.
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>
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>
It was necessary to have fallbacks to run the original tests. This
is obsolete with the new test mode.
PR-URL: https://github.com/nodejs/node/pull/31396
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
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>
This makes sure we do not retrieve the handler in case it's not
required. This improves the performance a tiny bit for these cases.
PR-URL: https://github.com/nodejs/node/pull/30767
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This adds a couple of benchmarks to check different options and code
paths.
PR-URL: https://github.com/nodejs/node/pull/30767
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
In benchmark util directory this changes for loops using var to let
when it applies for consistency
PR-URL: https://github.com/nodejs/node/pull/28867
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Rich Trott <rtrott@gmail.com>
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>
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>
This significantly reduces the benchmark runtime. It removes to many
variations that do not provide any benefit and reduces the iterations.
PR-URL: https://github.com/nodejs/node/pull/22503
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
1) Add missing unit tests by `ucs-2` in different kinds of cases.
2) Add missing unit tests by `usc-2` in different kinds of cases.
3) Fix a bug:We cannot find `ucs-2` in `case 5`'s `if` condition after
`toLowerCase()`
PR-URL: https://github.com/nodejs/node/pull/21455
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
An efficient JS implementation of a binary heap on top of an array with
worst-case O(log n) runtime for all operations, including arbitrary
item removal (unlike O(n) for most binary heap array implementations).
PR-URL: https://github.com/nodejs/node/pull/20555
Fixes: https://github.com/nodejs/node/issues/16105
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Do less variable allocations and reassignments inside spliceOne
since it's relied on by some performance sensitive code.
PR-URL: https://github.com/nodejs/node/pull/20453
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Create a minimal test for the util benchmark files.
PR-URL: https://github.com/nodejs/node/pull/16050
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.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>