Commit Graph

1157 Commits

Author SHA1 Message Date
Vinicius Lourenço
952cf0d17a
lib: reduce overhead of validateObject
PR-URL: https://github.com/nodejs/node/pull/49928
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-10-02 12:56:39 +00:00
Vinicius Lourenço
e6e320ecc7
perf_hooks: reduce overhead of new resource timings
PR-URL: https://github.com/nodejs/node/pull/49837
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-09-30 21:44:02 +00:00
Aras Abbasi
0ee9c83ffc
errors: improve performance of determine-specific-type
PR-URL: https://github.com/nodejs/node/pull/49696
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-09-30 21:43:40 +00:00
Robert Nagy
53b5545672
stream: writable state bitmap
PR-URL: https://github.com/nodejs/node/pull/49899
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-09-29 18:13:44 +00:00
Aras Abbasi
4f84a3d200
errors: improve formatList in errors.js
PR-URL: https://github.com/nodejs/node/pull/49642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-09-29 11:04:38 +00:00
Aras Abbasi
cc725a653a
errors: improve performance of instantiation
PR-URL: https://github.com/nodejs/node/pull/49654
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
2023-09-28 09:57:38 +00:00
CanadaHonk
7e0b6a5939
fs: improve error performance for unlinkSync
PR-URL: https://github.com/nodejs/node/pull/49856
Refs: https://github.com/nodejs/performance/issues/106
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-09-27 12:43:05 +00:00
Vinicius Lourenço
a6ad048b89
perf_hooks: reduce overhead of new performance_entries
PR-URL: https://github.com/nodejs/node/pull/49803
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2023-09-27 01:19:26 +00:00
Yagiz Nizipli
c829c03df2
url: improve invalid url performance
PR-URL: https://github.com/nodejs/node/pull/49692
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-09-26 15:40:17 +00:00
Yagiz Nizipli
f16f41c5b3
fs: improve readFileSync with file descriptors
PR-URL: https://github.com/nodejs/node/pull/49691
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2023-09-25 21:56:03 +00:00
Shubham Pandey
c0b4208fb9
test: refactor test-readline-async-iterators into a benchmark
PR-URL: https://github.com/nodejs/node/pull/49237
Fixes: https://github.com/nodejs/node/issues/49224
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-09-23 08:17:14 +00:00
Yagiz Nizipli
571ecbf992
fs: improve error performance of opendirSync
PR-URL: https://github.com/nodejs/node/pull/49705
Refs: https://github.com/nodejs/performance/issues/106
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-09-21 17:04:13 +00:00
Debadree Chatterjee
cd97e28860
benchmark: add a benchmark for read() of ReadableStreams
Refs: https://github.com/nodejs/performance/issues/82
PR-URL: https://github.com/nodejs/node/pull/49622
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-09-19 10:54:32 +00:00
Yagiz Nizipli
7e12d0e16d
fs: improve error performance of sync methods
PR-URL: https://github.com/nodejs/node/pull/49593
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2023-09-17 20:42:46 +00:00
Uzlopak
db8217b1bf
errors: improve classRegExp in errors.js
PR-URL: https://github.com/nodejs/node/pull/49643
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-09-16 01:36:48 +00:00
Uzlopak
4e01842943
net: improve performance of isIPv4 and isIPv6
PR-URL: https://github.com/nodejs/node/pull/49568
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-09-13 20:01:36 +00:00
Raz Luvaton
7ad4c0f4a6
benchmark: shorten pipe-to by reducing number of chunks
PR-URL: https://github.com/nodejs/node/pull/49577
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-09-13 19:44:44 +00:00
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
Antoine du Hamel
4d4c1e522e
tools: require more trailing commas
All of the import and export statements in the codebase already use
trailing commas, this commit adds a linter rule to enforce that.

PR-URL: https://github.com/nodejs/node/pull/46346
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-01-25 19:07:53 +01:00
Antoine du Hamel
e487638406
url: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/45966
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-01-22 14:13:24 +01:00
Brian White
863a41694c benchmark: remove buffer benchmarks redundancy
PR-URL: https://github.com/nodejs/node/pull/45735
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-01-22 07:45:22 +00:00
Brian White
1a8d340792 benchmark: introduce benchmark combination filtering
PR-URL: https://github.com/nodejs/node/pull/45735
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-01-22 07:45:21 +00:00
Deokjin Kim
a9bc3cf39b benchmark,tools: use os.availableParallelism()
Refs: https://github.com/nodejs/node/pull/45895
PR-URL: https://github.com/nodejs/node/pull/46003
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-01-11 20:07:57 +00:00
Jordan Harband
757c104147
tools: add prefer-proto rule
fixup: add support for `Object.create(null)`

fixup: extend to any 1-argument Object.create call

fixup: add tests
PR-URL: https://github.com/nodejs/node/pull/46083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-01-10 05:38:36 +00:00
Darshan Sen
e35e893d26
src: speed up process.getActiveResourcesInfo()
This change reduces the number of calls that were crossing the JS-C++
boundary to 1 and also removes the need for calling Array::New()
multiple times internally and ArrayPrototypeConcat-ing the results
later on, thus improving performance.

Refs: https://github.com/nodejs/node/pull/44445#pullrequestreview-1220052837
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46014
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-01-03 10:36:25 +00:00
Yagiz Nizipli
2ef13b8fb6 util: add fast path for text-decoder fatal flag
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>
2022-12-22 20:22:28 +00:00
Rafael Gonzaga
70d269de77
benchmark: include webstreams benchmark
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/45876
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2022-12-21 16:09:43 +00:00
Antoine du Hamel
3ce4cef4e6
tools: enforce use of trailing commas in tools/
PR-URL: https://github.com/nodejs/node/pull/45889
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-12-18 16:39:39 +00:00
Filip Skokan
7ad069c53c
crypto: use globalThis.crypto over require('crypto').webcrypto
PR-URL: https://github.com/nodejs/node/pull/45817
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-12-16 19:55:42 +00:00
Yagiz Nizipli
b06fd8cd45
benchmark: add variety of inputs to text-encoder
PR-URL: https://github.com/nodejs/node/pull/45787
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2022-12-10 14:45:22 +00:00
Joyee Cheung
2b9d3b2755
benchmark: make benchmarks runnable in older versions of Node.js
Also remove the require-cachable.js benchmarks because now all builtin
modules are cacheable, it would be comparing oranges to apples when
we try to compare the performance of loading all cacheable modules
in different Node.js binaries since the set of modules are just
different. Comparison of startup performance that involves loading
of the long-standing, stable builtins is already covered by the
require-builtins benchmark.

PR-URL: https://github.com/nodejs/node/pull/45746
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-12-08 14:50:18 +00:00
Yagiz Nizipli
09d083fe9b
benchmark: add v8 serialize benchmark
PR-URL: https://github.com/nodejs/node/pull/45476
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-11-21 18:18:44 +00:00
Yagiz Nizipli
cb96a130a5
benchmark: add text-encoder benchmark
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>
2022-11-18 19:48:01 +00:00
Khafra
916af4ef2d
buffer: introduce File
PR-URL: https://github.com/nodejs/node/pull/45139
Fixes: https://github.com/nodejs/node/issues/39015
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-11-10 20:52:45 +00:00
Yagiz Nizipli
86a5b71dc9 benchmark: add parameters to text-decoder benchmark
PR-URL: https://github.com/nodejs/node/pull/45363
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-11-09 14:17:30 +00:00
Yagiz Nizipli
e3b3c4697c benchmark: fix text-decoder benchmark
PR-URL: https://github.com/nodejs/node/pull/45363
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-11-09 14:17:29 +00:00
Yagiz Nizipli
e14321bb50
util: improve textdecoder decode performance
PR-URL: https://github.com/nodejs/node/pull/45294
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-11-06 20:27:41 +00:00
Thiago Oliveira Santos
0f3e531096
lib: performance improvement on readline async iterator
Using a direct approach to create the readline async iterator
allowed an iteration over 20 to 58% faster.

**BREAKING CHANGE**: With that change, the async iteterator
obtained from the readline interface doesn't have the
property "stream" any longer. This happened because it's no
longer created through a Readable, instead, the async
iterator is created directly from the events of the readline
interface instance, so, if anyone is using that property,
this change will break their code.
Also, the Readable added a backpressure control that is
fairly compensated by the use of FixedQueue + monitoring
its size. This control wasn't really precise with readline
before, though, because it only pauses the reading of the
original stream, but the lines generated from the last
message received from it was still emitted. For example:
if the readable was paused at 1000 messages but the last one
received generated 10k lines, but no further messages were
emitted again until the queue was lower than the readable
highWaterMark. A similar  behavior still happens with the
new implementation, but the highWaterMark used is fixed: 1024,
and the original stream is resumed again only after the queue
is cleared.

Before making that change, I created a package implementing
the same concept used here to validate it. You can find it
[here](https://github.com/Farenheith/faster-readline-iterator)
if this helps anyhow.

PR-URL: https://github.com/nodejs/node/pull/41276
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-24 12:49:16 +00:00
Yagiz Nizipli
6adaf23c20
benchmark: add blob benchmark
PR-URL: https://github.com/nodejs/node/pull/44990
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2022-10-17 12:00:31 +00:00
Yagiz Nizipli
267a03eb37
events: add unique events benchmark
Co-authored-by: Brian White <mscdex@mscdex.net>
PR-URL: https://github.com/nodejs/node/pull/44657
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-10-14 18:40:02 +03:00
Ruben Bridgewater
d3dd49fe2b
fs: improve promise based readFile performance for big files
This significantly reduces the peak memory for the promise
based readFile operation by reusing a single memory chunk after
each read and strinigifying that chunk immediately.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: https://github.com/nodejs/node/pull/44295
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-06 17:03:56 +00:00
Joyee Cheung
b3531bf735
benchmark: add vm context global proxy benchmark
PR-URL: https://github.com/nodejs/node/pull/44796
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-04 19:34:29 +08:00
Momtchil Momtchev
8671e4a116 test: upgrade all 1024 bit RSA keys to 2048 bits
Ubuntu 22.04 Jammy rejects 1024 bit RSA Keys

PR-URL: https://github.com/nodejs/node/pull/44498
Refs: https://github.com/nodejs/node/issues/44497
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-09-27 20:19:35 +02:00
Evan Lucas
962b9abbe3
benchmark: fix startup benchmark
This allows the misc/startup benchmark to run again
after the renaming of the C++ `native_module` to `builtins`

PR-URL: https://github.com/nodejs/node/pull/44727
Refs: https://github.com/nodejs/node/pull/44135
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-09-21 22:14:55 +00:00
SindreXie
869460aa58 benchmark: add stream destroy benchmark
PR-URL: https://github.com/nodejs/node/pull/44533
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
2022-09-13 14:14:49 +00:00
falsandtru
bae03c4e30
lib: fix reference leak
PR-URL: https://github.com/nodejs/node/pull/44499
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-09-07 09:33:10 +00:00
Yagiz Nizipli
f187fb45b4
fs: add encoding parameter to benchmarks
PR-URL: https://github.com/nodejs/node/pull/44278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2022-08-21 14:28:04 +00:00
legendecas
803a7b2b23
src,lib: print source map error source on demand
The source context is not prepended to the value of the `stack` property
when the source map is not enabled. Rather than prepending the error
source context to the value of the `stack` property unconditionally,
this patch aligns the behavior and only prints the source context when
the error is not handled by userland (e.g. fatal errors).

Also, this patch fixes that when source-map support is enabled, the
error source context is not pointing to where the error was thrown.

PR-URL: https://github.com/nodejs/node/pull/43875
Fixes: https://github.com/nodejs/node/issues/43186
Fixes: https://github.com/nodejs/node/issues/41541
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-07-28 08:09:30 +08:00
legendecas
02eb10b87b
lib,src: add source map support for global eval
Dynamic sources with FunctionConstructor is not supported yet as
V8 prepends lines to the sources which makes the stack line number
incorrect.

PR-URL: https://github.com/nodejs/node/pull/43428
Refs: https://github.com/nodejs/node/issues/43047
Reviewed-By: Ben Coe <bencoe@gmail.com>
2022-07-11 21:44:04 +08:00
Brian White
adef64ce63 benchmark: fix output regression
Fixes: https://github.com/nodejs/node/issues/43628

PR-URL: https://github.com/nodejs/node/pull/43635
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-07-08 15:47:35 +02:00
Paolo Insogna
d636fee319 benchmark: fix fork detection
PR-URL: https://github.com/nodejs/node/pull/43601
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-06-29 08:36:20 +02:00
Paolo Insogna
684e107965 benchmark: forcefully close processes
PR-URL: https://github.com/nodejs/node/pull/43557
Fixes: https://github.com/nodejs/build/issues/2968
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-06-27 12:29:47 +02:00
Adam Majer
9cde7a033e
crypto: don't disable TLS 1.3 without suites
In the manual page, there is a statement that ciphersuites contain
explicit default settings - all TLS 1.3 ciphersuites enabled.
In node, we assume that an empty setting mean no ciphersuites and
we disable TLS 1.3. A correct approach to disabling TLS 1.3 is to
disable TLS 1.3 and by not override the default ciphersuits
with an empty string.

So, only override OpenSSL's TLS 1.3 ciphersuites with an explicit
list of ciphers. If none are acceptable, the correct approach is
to disable TLS 1.3 instead elsewhere.

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

PR-URL: https://github.com/nodejs/node/pull/43427
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-06-27 09:47:13 +01:00
RafaelGSS
0903515e12 benchmark: add node-error benchmark
PR-URL: https://github.com/nodejs/node/pull/43077
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-30 09:54:21 -03:00
RafaelGSS
78c8d2a8c8 perf_hooks: add PerformanceResourceTiming
perf_hooks: create clearResourceTimings

perf_hooks: add resourcetiming test parallel

perf_hooks: add markResourceTiming

perf_hooks: fix observable when using resource

perf_hooks: fix observable when using resource

perf_hooks: add class comments

perf_hooks: add PerformanceResourceTiming

perf_hooks: create clearResourceTimings

perf_hooks: add resourcetiming test parallel

perf_hooks: add markResourceTiming

perf_hooks: fix observable when using resource

perf_hooks: fix observable when using resource

perf_hooks: add class comments

perf_hooks: add Resource Timing documentation

benchmark: measure resource timing module

perf_hooks: add check avoiding new PerformanceResourceTiming

perf_hooks: adjust doc

PR-URL: https://github.com/nodejs/node/pull/42725
Fixes: https://github.com/nodejs/undici/issues/952
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-05-13 09:20:01 -03:00
Antoine du Hamel
036c4d407b
benchmark: fix misc/startup failure
PR-URL: https://github.com/nodejs/node/pull/42746
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
2022-04-17 15:37:21 +01:00
Paolo Insogna
3caa2c1a00
http: refactor headersTimeout and requestTimeout logic
PR-URL: https://github.com/nodejs/node/pull/41263
Fixes: https://github.com/nodejs/node/issues/33440
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-13 15:47:59 +01:00
Rich Trott
b07894d8dc tools: enable no-var ESLint rule for lib
PR-URL: https://github.com/nodejs/node/pull/42573
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-04-04 10:53:29 +00:00
Antoine du Hamel
6ee4228498
crypto: validate this value for webcrypto.getRandomValues
PR-URL: https://github.com/nodejs/node/pull/41760
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-02-26 17:12:48 +00: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
Rich Trott
de677e9ac2 tools: enable no-empty ESLint rule
Refs: https://eslint.org/docs/rules/no-empty

PR-URL: https://github.com/nodejs/node/pull/41831
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-05 12:58:33 +00:00
Rich Trott
776d0b4e62 benchmark: enable no-empty ESLint rule
PR-URL: https://github.com/nodejs/node/pull/41831
Refs: https://eslint.org/docs/rules/no-empty
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-05 12:58:27 +00:00
Rich Trott
96e81df24a
benchmark: use Object.hasOwn() instead of hasOwnProperty()
PR-URL: https://github.com/nodejs/node/pull/41769
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-01-31 01:28:57 +00:00
Rich Trott
0018ee1f68
benchmark: replace hasOwnProperty() with Object.hasOwn()
PR-URL: https://github.com/nodejs/node/pull/41724
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-01-30 06:36:19 +00:00
Benjamin Gruenbaum
6bf769e4e6 benchmark: add subarray to buffer-slice
PR-URL: https://github.com/nodejs/node/pull/41596
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-22 00:34:58 +01:00
Michael Dawson
a199387f04 doc: make contributing info more discoverable
There are been several discussions in recent PRs about
the docs related to contributing not being very discoverable.
Move these docs from doc/guides/ to doc/contributing.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41408
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-18 14:24:30 -05:00
Rich Trott
a7215c8fa7
benchmark: remove unreachable code from crypto/hash-stream-creation
`hash.digest('buffer')` has returned a Buffer and not a string since at
least Node.js 0.10.6. The benchmark, as it is written, will not work on
any version of Node.js prior to 16.x (due to `Object.hasOwn()`) and
certainly won't run on versions earlier than 0.10.6 due to const/let and
probably other things. Remove impossible-to-reach code intended to
accommodate Node.js earlier than 0.10.6.

PR-URL: https://github.com/nodejs/node/pull/41535
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-01-17 05:31:21 +00:00
Rich Trott
36035e0657 benchmark: simplify http benchmarker regular expression
A non-capturing group inside a capturing group has no effect. Simplify
the regular expression.

PR-URL: https://github.com/nodejs/node/pull/38206
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
2022-01-11 22:57:30 -08:00
Rich Trott
55ceaec111 tools,benchmark,lib,test: enable no-case-declarations lint rule
PR-URL: https://github.com/nodejs/node/pull/41385
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-01-05 07:42:19 -08:00
Rich Trott
db02f6f132
benchmark: fix benchmark/run.js handling of --set
run.js does not work with --set as it tries to include it as
options to `fork()` rather than as part of argv for `fork()`. This
doesn't throw an error because of a quirk in `fork()` that silently
accepts arrays for options objects. This will be changing in Node.js
18.x.

PR-URL: https://github.com/nodejs/node/pull/41334
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-29 23:06:21 +00:00
Rich Trott
cf6996458b
benchmark,test: use Object.hasOwn() where applicable
Refs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn

PR-URL: https://github.com/nodejs/node/pull/41229
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-12-20 04:03:58 +00:00
Brian White
ed01811e71
benchmark: increase crypto DSA keygen params
OpenSSL 3.0 increased the minimum values for these parameters.

PR-URL: https://github.com/nodejs/node/pull/40416
Fixes: https://github.com/nodejs/node/issues/40410
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-10-16 06:03:10 -04:00
XadillaX
0ee0ed12c1 benchmark: add util.toUSVString()'s benchmark
PR-URL: https://github.com/nodejs/node/pull/40203
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-09-27 17:24:19 +08:00
Rich Trott
a6a5d4bda0 doc: update benchmarks README.md for upcoming linting/formatting
PR-URL: https://github.com/nodejs/node/pull/40158
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-21 17:02:07 -07:00
Stephen Belanger
926152a38c async_hooks: use resource stack for AsyncLocalStorage run
PR-URL: https://github.com/nodejs/node/pull/39890
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-08-31 17:04:35 +00:00
legendecas
062f8e3730
perf_hooks: web performance timeline compliance
All API introduced in this PR are compliant with web
[performance-timeline](https://w3c.github.io/performance-timeline)
spec. "performance-timeline" is listed as supported web spec in the doc
https://nodejs.org/docs/latest/api/perf_hooks.html#perf_hooks_performance_measurement_apis.

Changes summary:
1. Add new supported wpt test subsets: user-timing and
  performance-timeline.
2. Add support for `Performance.getEntries`,
  `Performance.getEntriesByName` and `Performance.getEntriesByType`
  to synchronously fetch buffered performance entries. This means
  the user should invoke `Performance.clearMarks` and
  `Performance.clearMeasures` to clear buffered entries to prevent from
  those entries been kept alive forever.
3. Add support (again after https://github.com/nodejs/node/pull/37136)
  for `buffered` flags for `PerformanceObserver`.
3. Fixes `PerformanceMark` and `PerformanceMeasure` wpt compliance
  issues.
4. Only user-created performance entries will be buffered globally. This
  behavior should be compliant with
  https://w3c.github.io/timing-entrytypes-registry/#registry.

With the new ability to fetch user-created performance entries
synchronously, the issues raised in
https://github.com/nodejs/diagnostics/issues/464#issuecomment-861920116
could also be fixed.

PR-URL: https://github.com/nodejs/node/pull/39297
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-25 23:43:31 +08:00
Michaël Zasso
2a1dea8a22
benchmark: output JSON-compatible numbers
This is to simplify the implementation of a JavaScript version of the
compare.R script.

PR-URL: https://github.com/nodejs/node/pull/38778
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-05-25 13:36:47 -07:00
Antoine du Hamel
ba84524a7c benchmark: fix http elapsed time
Since commit 4e9ad206e2, elapsed time is expected to be a BigInt
instead of an array.

Refs: https://github.com/nodejs/node/pull/38369

PR-URL: https://github.com/nodejs/node/pull/38743
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-05-23 14:52:14 +08:00
Voltrex
6e6663b8a4
events: use nullish coalencing operator
PR-URL: https://github.com/nodejs/node/pull/38328
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-05-17 12:26:29 -07:00
Antoine du Hamel
26e318a321
doc: use HEAD instead of master for links
PR-URL: https://github.com/nodejs/node/pull/38518
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-05-05 10:45:30 +02:00
Antoine du Hamel
0c879cb7b8 benchmark: avoid using console.log()
PR-URL: https://github.com/nodejs/node/pull/38370
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-04-27 12:28:30 +02:00
Antoine du Hamel
4e9ad206e2
benchmark: use process.hrtime.bigint()
PR-URL: https://github.com/nodejs/node/pull/38369
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-26 11:44:23 -07:00
Brian White
0180fc5b9b
benchmark: improve compare.R output
PR-URL: https://github.com/nodejs/node/pull/38118
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-04-12 14:28:46 -07:00
Filip Skokan
e8cb6446ef crypto: reconcile oneshot sign/verify sync and async implementations
PR-URL: https://github.com/nodejs/node/pull/37816
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-04-08 10:08:26 +02:00
Tobias Nießen
5dae7d6758 crypto: add buffering to randomInt
PR-URL: https://github.com/nodejs/node/pull/35110
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-04-03 15:37:53 +02:00
Rich Trott
448158e0f8 tools: simplify eslint comma-dangle configuration
Remove comma-dangle settings in benchmark/.eslintrc.yaml as they are the
same as what is set in .eslintrc.js.

PR-URL: https://github.com/nodejs/node/pull/37850
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-23 13:15:09 -07:00
wwwzbwcom
2c251ff33a stream: make Readable.from performance better
PR-URL: https://github.com/nodejs/node/pull/37609
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-03-22 11:19:35 +02:00
Nitzan Uziely
a97f01ea8c benchmark: add benchmark for fsPromises.writeFile
added fs.promises.writeFile benchmark

PR-URL: https://github.com/nodejs/node/pull/37610
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-03-13 13:41:00 +01:00
Nitzan Uziely
b9fd4eb651 fs: add promisified readFile benchmark
add a benchmark for fs.promises.readFile

PR-URL: https://github.com/nodejs/node/pull/37608
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-03-10 18:00:58 +02:00
James M Snell
f3eb224c83
perf_hooks: complete overhaul of the implementation
* Update the user timing implementation to conform to
  User Timing Level 3.
* Reimplement user timing and timerify with pure JavaScript
  implementations
* Simplify the C++ implementation for gc and http2 perf
* Runtime deprecate additional perf entry properties
  in favor of the standard detail argument
* Disable the `buffered` option on PerformanceObserver,
  all entries are queued and dispatched on setImmediate.
  Only entries with active observers are buffered.
* This does remove the user timing and timerify
  trace events. Because the trace_events are still
  considered experimental, those can be removed without
  a deprecation cycle. They are removed to improve
  performance and reduce complexity.

Old: `perf_hooks/usertiming.js n=100000: 92,378.01249733355`
New: perf_hooks/usertiming.js n=100000: 270,393.5280638482`

PR-URL: https://github.com/nodejs/node/pull/37136
Refs: https://github.com/nodejs/diagnostics/issues/464
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-02-22 08:46:11 -08:00
zhangyongsheng
aecd5ebf49 module: only set cache when finding module succeeds
PR-URL: https://github.com/nodejs/node/pull/36642
Fixes: https://github.com/nodejs/node/issues/36638
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-12 22:08:40 +08:00
bcoe
8c9dc4e9e6
benchmark: add benchmark for NODE_V8_COVERAGE
PR-URL: https://github.com/nodejs/node/pull/36972
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-01-27 14:31:37 -08: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
Tobias Nießen
ea2e2dfc52
benchmark: improve explanations in R script
PR-URL: https://github.com/nodejs/node/pull/36995
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-22 19:41:42 -08:00
raisinten
3dce4fb85f
test,benchmark: stop requiring URL and URLSearchParams
Since the URL and URLSearchParams classes are available in the
global object, there is no need to require them from 'url'.

PR-URL: https://github.com/nodejs/node/pull/36927
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-01-18 13:44:33 -08:00
Rich Trott
1c4fa9a48a benchmark: fix http2 benchmarks
Fixes: https://github.com/nodejs/node/issues/36746

PR-URL: https://github.com/nodejs/node/pull/36871
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2021-01-10 20:26:54 -08:00
James M Snell
0008a675ff crypto: implement randomuuid
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36729
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2021-01-07 12:44:36 -08:00
Rich Trott
1e35d5802a benchmark: fix http/headers.js with test-double
The http/headers.js benchmark fails if wrk or autocannon are not
installed. This is because the benchmark exceeds the default permissible
length for HTTP headers. Reduce the largest benchmarks to fit within the
8192 default as that is what we should be optimizing for.

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

PR-URL: https://github.com/nodejs/node/pull/36794
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-01-06 21:18:47 -08:00
Andrey Pechkurov
860c18be87 benchmark: add simple https benchmark
Adds a simple benchmark for https server based on the http simple
benchmark. Updates benchmarker integration for autocannon and wrk,
so that they support https scheme.

Also adds a new HTTPS section and improves HTTP/2 section in
the benchmark guide.

PR-URL: https://github.com/nodejs/node/pull/36612
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-25 18:11:44 +00:00
Momtchil Momtchev
656ce920a3 errors: eliminate all overhead for hidden calls
Eliminate all overhead for function calls that are to be
hidden from the stack traces at the expense of
reduced performance for the error case

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

PR-URL: https://github.com/nodejs/node/pull/35644
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-22 11:09:55 +01:00
Rich Trott
fee3b89a2b
benchmark: reduce code duplication
Merge duplicate case code in child-process-params.js.

PR-URL: https://github.com/nodejs/node/pull/36568
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-12-21 13:43:30 +01:00
Michaël Zasso
bf31d3c3b1
tools: enable no-unused-expressions lint rule
Fixes: https://github.com/nodejs/node/issues/36246

PR-URL: https://github.com/nodejs/node/pull/36248
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 20:33:45 +01:00
Antoine du Hamel
99f61677a9 benchmark,child_process: remove failing benchmark parameter
A 16 MiB strings seems to be too large to be send to the parent process,
making the whole benchmark throws.

PR-URL: https://github.com/nodejs/node/pull/36295
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-02 20:33:34 +00:00
Narasimha Prasanna HN
49abda71e2 benchmark : changed fstat to fstatSync
PR-URL: https://github.com/nodejs/node/pull/36206
Fixes: https://github.com/nodejs/node/issues/36199
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-11-26 07:28:59 +00:00
Gabriel Schulhof
39e4d82c70 benchmark: fix build warnings
The napi/* benchmarks were using an incorrect signature for the V8
add-on init function. This was causing a warning.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/36157
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2020-11-19 19:01:38 -08:00
Andrew Casey
3772cf56ae
lib: add throws option to fs.f/l/statSync
For consumers that aren't interested in *why* a `statSync` call failed,
allocating and throwing an exception is an unnecessary expense.  This PR
adds an option that will cause it to return `undefined` in such cases
instead.

As a motivating example, the JavaScript & TypeScript language service
shared between Visual Studio and Visual Studio Code is stuck with
synchronous file IO for architectural and backward-compatibility
reasons.  It frequently needs to speculatively check for the existence
of files and directories that may not exist (and cares about file vs
directory, so `existsSync` is insufficient), but ignores file system
entries it can't access, regardless of the reason.

Benchmarking the language service is difficult because it's so hard to
get good coverage of both code bases and user behaviors, but, as a
representative metric, we measured batch compilation of a few hundred
popular projects (by star count) from GitHub and found that, on average,
we saved about 1-2% of total compilation time.  We speculate that the
savings could be even more significant in interactive (language service
or watch mode) scenarios, where the same (non-existent) files need to be
polled over and over again.  It's not a huge improvement, but it's a
very small change and it will affect a lot of users (and CI runs).

For reference, our measurements were against `v12.x` (3637a061a at the
time) on an Ubuntu Server desktop with an SSD.

PR-URL: https://github.com/nodejs/node/pull/33716
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-11-18 16:19:33 -05:00
Richard Lau
85b42af439 benchmark: ignore build artifacts for napi addons
Add `.gitignore` to ignore the `build` directory in a similar way
to the other addons under `benchmark/napi`.

PR-URL: https://github.com/nodejs/node/pull/35970
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-07 02:57:54 +00:00
Richard Lau
540b79605b benchmark: remove modules that require intl
`inspector` and `trace_events` will throw errors if Node.js has been
compiled with `--without-intl`.

Refs: https://github.com/nodejs/node/pull/35816

PR-URL: https://github.com/nodejs/node/pull/35968
Fixes: https://github.com/nodejs/node/issues/35962
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-11-05 07:23:47 +00:00
Joyee Cheung
dbcadf005e
benchmark: make the benchmark tool work with Node 10
Avoid using class fields in the benchmark tools since they are
not available in Node 10. This can be reverted when Node 10
reaches EOL.

PR-URL: https://github.com/nodejs/node/pull/35817
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2020-11-04 10:40:14 +08:00
Joyee Cheung
38c15691eb
benchmark: add startup benchmark for loading public modules
Adding a new benchmark for testing the performance of loading
available public modules.

PR-URL: https://github.com/nodejs/node/pull/35816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-04 10:39:13 +08:00
Stephen Belanger
7231b5139e http: report request start and end with diagnostics_channel
PR-URL: https://github.com/nodejs/node/pull/34895
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-10-31 21:24:12 +00:00
Stephen Belanger
c6c36c3da7 lib: create diagnostics_channel module
PR-URL: https://github.com/nodejs/node/pull/34895
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-10-31 21:24:11 +00:00
Andrey Pechkurov
761c1b0797 tls: allow reading data into a static buffer
Refs: #25436

PR-URL: https://github.com/nodejs/node/pull/35753
Refs: https://github.com/nodejs/node/pull/25436
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-10-28 16:07:29 +03:00
Trevor Norris
04d16646a0 worker: add eventLoopUtilization()
Allow calling eventLoopUtilization() directly on a worker thread:

    const worker = new Worker('./foo.js');
    const elu = worker.performance.eventLoopUtilization();
    setTimeout(() => {
      worker.performance.eventLoopUtilization(elu);
    }, 10);

Add a new performance object on the Worker instance that will hopefully
one day hold all the other performance metrics, such as nodeTiming.

Include benchmarks and tests.

PR-URL: https://github.com/nodejs/node/pull/35664
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-27 09:43:20 +01:00
Guy Bedford
f3ce2811dd module: use Wasm CJS lexer when available
PR-URL: https://github.com/nodejs/node/pull/35583
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
2020-10-12 04:24:41 -07:00
James M Snell
dae283d96f
crypto: refactoring internals, add WebCrypto
Fixes: https://github.com/nodejs/node/issues/678
Refs: https://github.com/nodejs/node/issues/26854

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/35093
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-07 17:27:05 -07:00
Trevor Norris
589b2a1244 perf_hooks: add idleTime and event loop util
Use uv_metrics_idle_time() to return a high resolution millisecond timer
of the amount of time the event loop has been idle since it was
initialized.

Include performance.eventLoopUtilization() API to handle the math of
calculating the idle and active times. This has been added to prevent
accidental miscalculations of the event loop utilization. Such as not
taking into consideration offsetting nodeTiming.loopStart or timing
differences when being called from a Worker thread.

PR-URL: https://github.com/nodejs/node/pull/34938
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-08-29 07:02:31 -07:00
Yash Ladha
56b25e7a6f benchmark: add benchmark script for resourceUsage
Added a benchmark script for process method to benchmark the method
resourceUsage.

PR-URL: https://github.com/nodejs/node/pull/34691
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
2020-08-13 22:33:07 +08:00
Anna Henningsen
9dac8cbbc3 benchmark: update function_args addon code
Make the code linter-conformant and remove usage of deprecated APIs.

PR-URL: https://github.com/nodejs/node/pull/34725
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-11 13:29:14 -07:00
Gabriel Schulhof
cc7ec889e8 n-api: support type-tagging objects
`napi_instanceof()` is insufficient for reliably establishing the data
type to which a pointer stored with `napi_wrap()` or
`napi_create_external()` inside a JavaScript object points. Thus, we
need a way to "mark" an object with a value that, when later retrieved,
can unambiguously tell us whether it is safe to cast the pointer stored
inside it to a certain structure.

Such a check must survive loading/unloading/multiple instances of an
addon, so we use UUIDs chosen *a priori*.

Fixes: https://github.com/nodejs/node/issues/28164
Co-authored-by: Anna Henningsen <github@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/28237
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
2020-07-31 18:30:30 -07:00
Anna Henningsen
b14ce72353 benchmark: always throw the same Error instance
Stack trace capturing currently accounts for 40 % of the benchmark
running time. Always throwing the same exception object removes
that overhead and lets the benchmark be more focused on what it is
supposed to measure.

Refs: https://github.com/nodejs/node/pull/34512#issuecomment-663977271

PR-URL: https://github.com/nodejs/node/pull/34523
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-07-29 10:59:26 +03:00
Andrey Pechkurov
53870ddeac async_hooks: optimize fast-path promise hook for ALS
Remove unnecessary native-to-JS code switches in fast-path for
PromiseHooks. Those switches happen even if a certain type of
hook (say, before) is not installed, which may lead to sub-optimal
performance in the AsyncLocalStorage scenario, i.e. when there is
only an init hook.

PR-URL: https://github.com/nodejs/node/pull/34512
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-07-28 10:54:01 +03:00
Gabriel Schulhof
a74a6e3ba1 n-api: run all finalizers via SetImmediate()
Throwing an exception from a finalizer can cause the following fatal
error:

Error: async hook stack has become corrupted (actual: 2, expected: 0)
 1: 0x970b5a node::InternalCallbackScope::~InternalCallbackScope()
    [./node]
 2: 0x99dda0 node::Environment::RunTimers(uv_timer_s*) [./node]
 3: 0x13d8b22  [./node]
 4: 0x13dbe42 uv_run [./node]
 5: 0xa57974 node::NodeMainInstance::Run() [./node]
 6: 0x9dbc17 node::Start(int, char**) [./node]
 7: 0x7f4965417f43 __libc_start_main [/lib64/libc.so.6]
 8: 0x96f4ae _start [./node]

By https://github.com/nodejs/node/issues/34341#issuecomment-658426281,
calling into JS from a finalizer and/or throwing exceptions from there
is not advised, because the stack may or may not be set up for JS
execution. The best solution is to run the user's finalizer from a
`SetImmediate()` callback.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: https://github.com/nodejs/node/issues/34341
PR-URL: https://github.com/nodejs/node/pull/34386
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-07-23 23:28:09 -07:00
Anna Henningsen
459d3a015a
worker: make MessagePort inherit from EventTarget
Use `NodeEventTarget` to provide a mixed `EventEmitter`/`EventTarget`
API interface.

PR-URL: https://github.com/nodejs/node/pull/34057
Refs: https://twitter.com/addaleax/status/1276289101671608320
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-07-22 22:59:11 +02:00
Rich Trott
d10c59fc60 benchmark,test: remove output from readable-async-iterator benchmark
Extra output makes test-benchmark-streams fail. Change console.log() to
console.assert().

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

PR-URL: https://github.com/nodejs/node/pull/34411
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-07-17 08:41:15 -07:00
Robert Nagy
08e8997d54 stream: simpler and faster Readable async iterator
Reimplement as an async generator instead of a custom
iterator class.

PR-URL: https://github.com/nodejs/node/pull/34035
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-17 09:06:27 +02:00
Bradley Farias
66810a0d47 policy: add startup benchmark and make SRI lazier
PR-URL: https://github.com/nodejs/node/pull/29527
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-14 13:03:04 -05:00
Brian White
336546b075
benchmark: fix EventTarget benchmark
Fixes: https://github.com/nodejs/node/issues/33782

PR-URL: https://github.com/nodejs/node/pull/34015
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 17:08:13 -07:00
Brian White
a4f3206b76
events: improve listeners() performance
PR-URL: https://github.com/nodejs/node/pull/33863
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-06-17 12:12:49 -07:00
cjihrig
85fbf7175e
tools: update ESLint to 7.2.0
Update ESLint to 7.2.0

PR-URL: https://github.com/nodejs/node/pull/33776
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2020-06-13 16:44:03 -04:00
Brian White
7b46793eee
querystring: improve stringify() performance
PR-URL: https://github.com/nodejs/node/pull/33669
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-12 18:21:44 -04:00
Brian White
4ba90809ed
events: improve arrayClone performance
PR-URL: https://github.com/nodejs/node/pull/33774
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-06-08 15:21:13 -04:00
Anna Henningsen
f5ed5fe068
benchmark: fix async-resource benchmark
In the benchmark, because it performs asynchronous operations before
writing its HTTP replies, the underlying socket can be closed by the
peer before the response is written. Since 28e6626ce7, that means
that attempting to `.end()` the HTTP response results in an uncaught
exception, breaking the benchmark.

Fix that by checking whether the response object has been destroyed
or not before attempting to call `.end()`.

https://github.com/nodejs/node/issues/33591

PR-URL: https://github.com/nodejs/node/pull/33642
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-06-06 17:36:52 +02:00
James M Snell
785842a053 events: initial implementation of experimental EventTarget
See documentation changes for details

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33556
Refs: https://github.com/nodejs/node/pull/33527
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-05-28 06:31:58 -07:00
Adrian Estrada
6af15ebf22 benchmark: fixing http_server_for_chunky_client.js
PR-URL: https://github.com/nodejs/node/pull/33271
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-23 19:34:53 +02:00
Luigi Pinca
b533fb3508 tools: enable no-else-return lint rule
Refs: https://github.com/nodejs/node/pull/32644
Refs: https://github.com/nodejs/node/pull/32662

PR-URL: https://github.com/nodejs/node/pull/32667
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-05-16 06:42:16 +02:00
Anna Henningsen
c7eeef568c
cli: add --trace-atomics-wait flag
Adds a flag that helps with debugging deadlocks due to incorrectly
implemented `Atomics.wait()` calls.

PR-URL: https://github.com/nodejs/node/pull/33292
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-05-15 19:37:40 +02:00
Stephen Belanger
13c5a1629c
async_hooks: move PromiseHook handler to JS
This avoids the need to wrap every promise in an AsyncWrap and also
makes it easier to skip the machinery to track destroy events when
there's no destroy listener.

Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32891
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2020-05-09 07:52:22 +02:00
Robert Nagy
003fb53c9a stream: avoid drain for sync streams
Previously a sync writable receiving chunks
larger than highwatermark would unecessarily
ping pong needDrain.

PR-URL: https://github.com/nodejs/node/pull/32887
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-25 18:45:50 +02:00
Andrey Pechkurov
50dd63e8ef
async_hooks: merge run and exit methods
PR-URL: https://github.com/nodejs/node/pull/31950
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-04-13 18:37:44 +02:00
Andrey Pechkurov
561dda273f async_hooks: move to lazy destroy hook registration in AsyncResource
PR-URL: https://github.com/nodejs/node/pull/32429
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
2020-04-06 16:14:43 +02:00
Andrey Pechkurov
7e664a554a benchmark: fix error on server close in AsyncLocalStorage benchmark
PR-URL: https://github.com/nodejs/node/pull/32503
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-04-02 14:53:24 +02:00
Daniele Belardi
75aaf7496e
benchmark: use let instead of var in zlib
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:24 +02:00
Daniele Belardi
806899fdba
benchmark: use let instead of var in worker
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:22 +02:00
Daniele Belardi
d9a77c6416
benchmark: use let instead of var in util
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:21 +02:00
Daniele Belardi
a33e9c9d80
benchmark: use let instead of var in url
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:20 +02:00
Daniele Belardi
8ec533d890
benchmark: use let instead of var in tls
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:18 +02:00
Daniele Belardi
de877c5781
benchmark: use let instead of var in timers
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:16 +02:00
Daniele Belardi
13ad05ce4c
benchmark: use let instead of var in run.js
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:15 +02:00
Daniele Belardi
a2e7015782
benchmark: use let instead of var in dns
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:14 +02:00
Daniele Belardi
e18f5af270
benchmark: use let instead of var in common.js
PR-URL: https://github.com/nodejs/node/pull/31794
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-30 10:16:12 +02:00