Commit Graph

990 Commits

Author SHA1 Message Date
Raz Luvaton
a7fe8b042a
stream: improve tee perf by reduce ReflectConstruct usages
also added more webstream creation benchmarks

PR-URL: https://github.com/nodejs/node/pull/49546
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-09-11 07:45:11 +00:00
Raz Luvaton
7bf29b52b3
benchmark: fix webstream pipe-to
PR-URL: https://github.com/nodejs/node/pull/49552
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2023-09-08 12:53:40 +00:00
Livia Medeiros
fcf5de008a
benchmark: use tmpdir.resolve()
PR-URL: https://github.com/nodejs/node/pull/49137
Refs: https://github.com/nodejs/node/pull/49079
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-08-30 09:55:20 +00:00
Livia Medeiros
eeddbfae6c
test,benchmark: use tmpdir.fileURL()
PR-URL: https://github.com/nodejs/node/pull/49138
Refs: https://github.com/nodejs/node/pull/49040
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-08-21 16:42:03 +00:00
Raz Luvaton
f458e5b573
benchmark: add benchmarks for the test_runner
PR-URL: https://github.com/nodejs/node/pull/48931
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-07-29 18:07:44 +00:00
Rafael Gonzaga
0da3f61a19
benchmark: add pm startup benchmark
PR-URL: https://github.com/nodejs/node/pull/48905
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2023-07-26 22:37:56 +00:00
Antoine du Hamel
053511f7ec
module: ensure successful import returns the same result
PR-URL: https://github.com/nodejs/node/pull/46662
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2023-07-26 20:34:20 +00:00
Yagiz Nizipli
b76862df0a
fs: add a fast-path for readFileSync utf-8
PR-URL: https://github.com/nodejs/node/pull/48658
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-07-12 18:37:42 +00:00
Vinicius Lourenço
a2a8e31cbc
src,lib: reducing C++ calls of esm legacy main resolve
Instead of many C++ calls, now we make only one C++ call
to return a enum number that represents the selected state.

PR-URL: https://github.com/nodejs/node/pull/48325
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-07-03 18:42:47 +00:00
Rafael Gonzaga
affc6aca03
benchmark: add bar.R
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/47729
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2023-06-28 13:07:19 +00:00
Gabriel Schulhof
3c35cd4a74 node-api: provide napi_define_properties fast path
Implement defining properties via V8's
`v8::Object::CreateDataProperty()`, which is faster for data-valued,
writable, configurable, and enumerable properties.

Re: https://github.com/nodejs/node/issues/45905
Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48440
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-06-15 18:07:30 -07:00
Gabriel Schulhof
60d9aed307 node-api: implement external strings
Introduce APIs that allow for the creation of JavaScript strings without
copying the underlying native string into the engine. The APIs fall back
to regular string creation if the engine's external string APIs are
unavailable. In this case, an optional boolean out-parameter indicates
that the string was copied, and the optional finalizer is called if
given.

PR-URL: https://github.com/nodejs/node/pull/48339
Fixes: https://github.com/nodejs/node/issues/48198
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com>
2023-06-13 21:54:03 -07:00
Filip Skokan
0e92bf1b66
benchmark: refactor crypto oneshot
PR-URL: https://github.com/nodejs/node/pull/48267
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-06-05 19:00:41 +00:00
Filip Skokan
6327d4582a
benchmark: add crypto.create*Key
PR-URL: https://github.com/nodejs/node/pull/48284
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-05 16:45:47 +00:00
Deokjin Kim
ca096563e0
benchmark: use cluster.isPrimary instead of cluster.isMaster
`cluster.isMaster` was deprecated. So need to use `cluster.isPrimary`
for benchmark.

Refs: https://github.com/nodejs/node/pull/47981
PR-URL: https://github.com/nodejs/node/pull/48002
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-05-17 05:51: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
Rafael Gonzaga
b5fe45fb9a
benchmark: add eventtarget creation bench
PR-URL: https://github.com/nodejs/node/pull/47774
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-04-30 21:09:56 +00:00
Yagiz Nizipli
cd0fcf20c3
benchmark: differentiate whatwg and legacy url
PR-URL: https://github.com/nodejs/node/pull/47377
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
2023-04-13 21:37:17 +00:00
Antoine du Hamel
4afb25ccfd
benchmark: add a benchmark for defaultResolve
PR-URL: https://github.com/nodejs/node/pull/47543
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2023-04-13 19:49:54 +00:00
Rafael Gonzaga
6fd147c4b0
permission: drop process.permission.deny
PR-URL: https://github.com/nodejs/node/pull/47335
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2023-04-04 17:14:04 +00:00
Deokjin Kim
edaa9f4102
benchmark: fix invalid requirementsURL
Location of `writing-and-running-benchmarks.md` is `doc/contributing`
(not benchmark).

PR-URL: https://github.com/nodejs/node/pull/47378
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-04-03 23:52:21 +00:00
Khafra
39a08ee8b8 benchmark: lower URL.canParse runs
PR-URL: https://github.com/nodejs/node/pull/47351
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-03-31 17:15:32 -07:00
Khafra
f2651a0812
url: implement URL.canParse
PR-URL: https://github.com/nodejs/node/pull/47179
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-03-22 19:44:44 +00:00
Debadree Chatterjee
28c9fb9592
benchmark: add a benchmark for URLSearchParams creation and toString()
Refs: https://github.com/nodejs/performance/issues/56
PR-URL: https://github.com/nodejs/node/pull/46810
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-03-13 10:37:41 +00:00
Theodor Steiner
10c1ab00fd
benchmark: replace table in docs with description of file tree structure
The markdown table in `benchmark/README.md` has grown stale, no
longer providing an overview over all existing benchmarks. As it has
proven difficult to keep an exhaustive listing of available benchmarks
up to date, this commit provides a description of how the directory is
structured instead.

PR-URL: https://github.com/nodejs/node/pull/46991
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-03-11 09:53:50 +00:00
Joyee Cheung
044021d341
benchmark: stablize encode benchmark
- 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>
2023-03-07 22:45:40 +01:00
RafaelGSS
b164038c86 permission: fix spawnSync permission check
Fixes: https://github.com/nodejs-private/node-private/issues/394

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/46975
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-03-07 13:07:20 -03:00
Joyee Cheung
43ddf7631e
benchmark: split Buffer.byteLength benchmark
PR-URL: https://github.com/nodejs/node/pull/46616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-26 19:02:42 +01:00
Debadree Chatterjee
80a7843bfc
benchmark: add benchmark for EventTarget add and remove
Refs: https://github.com/nodejs/performance/issues/60
PR-URL: https://github.com/nodejs/node/pull/46779
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-26 05:30:26 +00:00
Rafael Gonzaga
00c222593e
src,process: add permission model
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/44004
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-23 18:11:51 +00:00
Joyee Cheung
9e06ef0a10
benchmark: fix worker startup benchmark
It previously called spawnProcess in spawnWorker, which was
incorrect.

PR-URL: https://github.com/nodejs/node/pull/46680
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-23 14:10:00 +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
Ruben Bridgewater
fbd55a8139
lib: do not crash using workers with disabled shared array buffers
This allows the repl to function normally while using the
`--no-harmony-sharedarraybuffer` V8 flag.
It also fixes using workers while using the
`--no-harmony-atomics` V8 flag.

Fixes: https://github.com/nodejs/node/issues/39717

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/41023
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-02-18 11:18:04 +01:00
Antoine du Hamel
3acdeb1f7a
benchmark: add trailing commas in benchmark/path
PR-URL: https://github.com/nodejs/node/pull/46628
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-02-14 17:09:42 +00:00
Antoine du Hamel
5c74108891
benchmark: add trailing commas in benchmark/http
PR-URL: https://github.com/nodejs/node/pull/46609
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-02-12 16:32:00 +00:00
Antoine du Hamel
214b00d215
benchmark: add trailing commas in benchmark/crypto
PR-URL: https://github.com/nodejs/node/pull/46553
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-02-10 00:54:53 +00:00
Antoine du Hamel
3aef395ed5
benchmark: add trailing commas in benchmark/url
PR-URL: https://github.com/nodejs/node/pull/46551
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-02-10 00:54:40 +00:00
Antoine du Hamel
71646e2eca
benchmark: add trailing commas in benchmark/http2
PR-URL: https://github.com/nodejs/node/pull/46552
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-02-09 23:15:52 +00:00
Antoine du Hamel
f466fe5ecc
benchmark: add trailing commas in benchmark/process
PR-URL: https://github.com/nodejs/node/pull/46481
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-02-05 11:00:09 +00:00
Antoine du Hamel
806a516851
benchmark: add trailing commas in benchmark/misc
PR-URL: https://github.com/nodejs/node/pull/46474
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-02-04 18:19:36 +00:00
Antoine du Hamel
95434fbf28
benchmark: add trailing commas in benchmark/buffers
PR-URL: https://github.com/nodejs/node/pull/46473
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-02-04 18:19:25 +00:00
Chengzhong Wu
3000d77017
async_hooks: add async local storage propagation benchmarks
Add micro-benchmarks to verify the performance degradation related to
the number of active `AsyncLocalStorage`s.

With these benchmarks, trying to improve the async context propagation
to be an O(1) operation, which is an operation more frequent compared
to `asyncLocalStorage.run` and `asyncLocalStorage.getStore`.

PR-URL: https://github.com/nodejs/node/pull/46414
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2023-02-03 21:12:17 +00:00
Antoine du Hamel
279839dc43
benchmark: add trailing commas in benchmark/module
PR-URL: https://github.com/nodejs/node/pull/46461
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-03 11:45:13 +01:00
Antoine du Hamel
fd4869b3f3
benchmark: add trailing commas in benchmark/net
PR-URL: https://github.com/nodejs/node/pull/46439
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-03 11:43:15 +01:00
Antoine du Hamel
83cc1e2c8b
benchmark: add trailing commas in benchmark/util
PR-URL: https://github.com/nodejs/node/pull/46438
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-03 11:42:25 +01:00
Antoine du Hamel
997c47fba7
benchmark: add trailing commas in benchmark/async_hooks
PR-URL: https://github.com/nodejs/node/pull/46424
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-02-01 21:46:09 +00:00
Antoine du Hamel
9e5d1af3ea
benchmark: add trailing commas in benchmark/fs
PR-URL: https://github.com/nodejs/node/pull/46426
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2023-02-01 19:16:18 +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