RafaelGSS
248d5e0dac
benchmark: add match and doesNotMatch bench
...
PR-URL: https://github.com/nodejs/node/pull/54734
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-09-05 15:02:30 +00:00
RafaelGSS
b26238132b
benchmark: add rejects and doesNotReject bench
...
PR-URL: https://github.com/nodejs/node/pull/54734
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-09-05 15:02:29 +00:00
RafaelGSS
0b283c2b97
benchmark: add throws and doesNotThrow bench
...
PR-URL: https://github.com/nodejs/node/pull/54734
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-09-05 15:02:29 +00:00
RafaelGSS
688c885326
benchmark: add strictEqual and notStrictEqual bench
...
PR-URL: https://github.com/nodejs/node/pull/54734
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-09-05 15:02:28 +00:00
Lei Shi
e8de0f5869
benchmark: update iterations of assert/deepequal-typedarrays.js
...
Fixes: https://github.com/nodejs/node/issues/50571
PR-URL: https://github.com/nodejs/node/pull/51419
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2024-02-28 09:08:05 +00:00
Lei Shi
6c080f6e13
benchmark: update iterations of benchmark/assert/deepequal-map.js
...
Fixed: https://github.com/nodejs/node/issues/50571
PR-URL: https://github.com/nodejs/node/pull/51416
Fixes: https://github.com/nodejs/node/issues/50571
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2024-02-28 09:07:57 +00:00
Ruben Bridgewater
449e9f4489
assert,util: improve deep equal comparison performance
...
This is mainly a performance improvement for a lot of simple cases.
Diverging elements are detected earlier and equal entries are
partially also detected faster.
A small correctness patch is also included where recursions now
stop as soon as either side has a circular structure. Before, both
sides had to have a circular structure at the specific comparison
which could have caused more checks that likely fail at a later
point.
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de >
PR-URL: https://github.com/nodejs/node/pull/46593
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-02-20 15:47:06 +01:00
Ruben Bridgewater
841279d79c
benchmark: rework assert benchmarks for correctness
...
This reworks most assert benchmarks to provide more reliable test
cases that also test more cases than before while keeping the
runtime low.
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de >
PR-URL: https://github.com/nodejs/node/pull/46593
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-02-20 15:46:55 +01: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
MrJithil
217acb9036
benchmark: avoid input param manipulation
...
PR-URL: https://github.com/nodejs/node/pull/41741
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Mary Marchini <oss@mmarchini.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-02-05 08:26:37 -08:00
Ruben Bridgewater
bb6125bac7
benchmark: remove special test entries
...
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 >
2020-03-09 22:35:54 +01:00
Anna Henningsen
7cfbc9f90f
Revert "benchmark: remove special test entries"
...
This reverts commit 357230f4b7 .
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:08 +01:00
Ruben Bridgewater
357230f4b7
benchmark: remove special test entries
...
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 >
2020-02-09 13:32:12 +01:00
dnlup
d1ce04c592
benchmark: use let instead of var in assert
...
PR-URL: https://github.com/nodejs/node/pull/30450
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-17 18:31:54 +05:30
Rich Trott
3418956349
benchmark: use consistent coding style in assert/*
...
Files in benchmark/assert/* were sometimes using trailing commas for
multi-line objects and sometimes not, mixing the approaches in the same
file sometimes. Standardize these files to always use trailing commas in
multi-line objects.
Additionally, remove some unnecessary line-wrapping (so that there are
fewer multi-line objects).
PR-URL: https://github.com/nodejs/node/pull/25865
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
2019-02-03 01:48:32 -08:00
Ruben Bridgewater
5442c28b65
benchmark: improve assert benchmarks
...
This reduces the runtime and makes sure the strict and loose options
can be tested individually.
Besides that a couple of redundant cases were removed.
PR-URL: https://github.com/nodejs/node/pull/22211
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-08-13 11:46:40 +02:00
Rich Trott
f86e5fc437
benchmark: refactor benchmark/assert/throws.js
...
This is a minor refactor of benchmark/assert/throws.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:29 +02:00
Rich Trott
b8f8ca5702
benchmark: refactor deepequal-typedarrays
...
This is a minor refactor of benchmark/assert/deepequal-typedarrays.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:28 +02:00
Rich Trott
9cd4a23b79
benchmark: refactor deepequal-set
...
This is a minor refactor of benchmark/assert/deepequal-set.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:26 +02:00
Rich Trott
30650a62d9
benchmark: refactor prims-and-objs-big-loop
...
This is a minor refactor of
benchmark/assert/deepequal-prims-and-objs-big-loop.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:25 +02:00
Rich Trott
7bfc00d848
benchmark: refactor prims-and-objs-big-array-set
...
This is a minor refactor of
benchmark/assert/deepequal-prims-and-objs-big-array-set.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:23 +02:00
Rich Trott
07d3c55eca
benchmark: refactor deepequal-object
...
This is a minor refactor of benchmark/assert/deepequal-object.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:22 +02:00
Rich Trott
1000c785bd
benchmark: refactor deepequal-map
...
This is a minor refactor of benchmark/assert/deepequal-map.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:20 +02:00
Rich Trott
206b19cc3f
benchmark: refactor deepequal-buffer
...
This is a minor refactor of benchmark/assert/deepequal-buffer.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-06-02 05:17:19 +02:00
Brian White
3c61b87e59
assert: improve assert()/assert.ok() performance
...
PR-URL: https://github.com/nodejs/node/pull/19292
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Yuta Hiroto <hello@hiroppy.me >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-03-15 12:57:35 -04:00
Ruben Bridgewater
15bb8437fd
tools: add assert.doesNotThrow eslint rule
...
Prohibit the usage of `assert.doesNotThrow()`.
PR-URL: https://github.com/nodejs/node/pull/18669
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-02-16 16:54:57 +01:00
Ruben Bridgewater
cd7b2c434c
benchmark: (assert) refactor
...
PR-URL: https://github.com/nodejs/node/pull/18320
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-02-01 10:48:58 +01:00
Ruben Bridgewater
366fd03af0
benchmark: (assert) use destructuring
...
PR-URL: https://github.com/nodejs/node/pull/18250
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-01-23 01:29:15 +01:00
sreepurnajasti
f6ae451a96
benchmark: remove redundant +
...
PR-URL: https://github.com/nodejs/node/pull/17803
Refs: https://github.com/nodejs/code-and-learn/issues/72
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-01-19 11:24:17 +01:00
Rich Trott
3c4c0db26a
benchmark: provide default methods for assert
...
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 >
2017-09-15 15:34:39 -07:00
Rich Trott
11f46a2586
benchmark: enable assert benchmark with short len
...
`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 >
2017-09-15 15:34:32 -07:00
Ruben Bridgewater
a7189c0177
benchmark: fix and extend assert benchmarks
...
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 >
2017-08-13 14:31:27 -04:00
Ruben Bridgewater
462b58e581
benchmark: add assert map and set benchmarks
...
PR-URL: https://github.com/nodejs/node/pull/14258
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-19 19:25:56 -04: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
Joyee Cheung
5e4545e18f
benchmark: add assert.deep[Strict]Equal benchmarks
...
* Move numbers into configuration
* Add buffer comparison benchmark
* Add assert.deepStrictEqual benchmarks
PR-URL: https://github.com/nodejs/node/pull/11092
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-02-06 11:25:21 +08:00
Rich Trott
d4061a6314
tools: replace custom ESLint rule with built-in
...
ESLint 3.5.0 introduces a `no-restricted-properties` rule. Replace our
custom `no-deepEqual` rule with this rule.
PR-URL: https://github.com/nodejs/node/pull/8478
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-09-12 21:12:03 -07:00
Rich Trott
a7335bd1f0
test,benchmark: use deepStrictEqual()
...
In preparation for a lint rule that will enforce
assert.deepStrictEqual() over assert.deepEqual(), change tests and
benchmarks accordingly. For tests and benchmarks that are testing or
benchmarking assert.deepEqual() itself, apply a comment to ignore the
upcoming rule.
PR-URL: https://github.com/nodejs/node/pull/6213
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2016-04-22 14:38:09 -07:00
Andreas Madsen
15720fa25a
benchmark: fix configuation parameters
...
The benchmark runner spawns new processes for each configuration. The
specific configuration is transfered by process.argv. This means that
the values have to be parsed. As of right now only numbers and strings
are parsed correctly. However other values such as objects where used.
This fixes the benchmarks that used non-string/number values and
prevents future issues by asserting the type.
PR-URL: https://github.com/nodejs/node/pull/5177
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
2016-02-26 20:29:10 +11:00
Claudio Rodriguez
63786227cc
assert: typed array deepequal performance fix
...
assert.deepEqual: when actual and expected are typed arrays,
wrap them in a new Buffer each to increase performance
significantly.
PR-URL: https://github.com/nodejs/node/pull/4330
Fixes: https://github.com/nodejs/node/issues/4294
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2015-12-21 18:04:01 +01:00