Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V23.1.0 proposal #55513

Merged
merged 93 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
d3618b2
benchmark: adjust config for deepEqual object
RafaelGSS Oct 11, 2024
d9fde2c
meta: bump step-security/harden-runner from 2.9.1 to 2.10.1
dependabot[bot] Oct 11, 2024
5ffc721
meta: bump github/codeql-action from 3.26.6 to 3.26.10
dependabot[bot] Oct 11, 2024
335a507
meta: bump codecov/codecov-action from 4.5.0 to 4.6.0
dependabot[bot] Oct 11, 2024
59923d1
test: update `compression` wpt
Oct 11, 2024
055d2b8
deps: update amaro to 0.1.9
nodejs-github-bot Oct 12, 2024
48bb87b
esm: mark import attributes and JSON module as stable
nicolo-ribaudo Oct 12, 2024
fe667be
assert: fix deepEqual always return true on URL
meixg Oct 13, 2024
07ad987
lib: convert transfer sequence to array in js
jazelly Oct 13, 2024
41f68f5
doc: fix ambasador markdown list
RafaelGSS Oct 13, 2024
bdc2c3b
doc: add missing return values in buffer docs
karlhorky Oct 13, 2024
d42522e
build: fix make errors that occur in Makefile
kmk324 Oct 14, 2024
eb2fab3
test: update test_util.cc for coverage
kmk324 Oct 14, 2024
bfb3c62
deps: update libuv to 1.49.1
santigimeno Oct 11, 2024
54d55f2
Revert "deps: disable io_uring support in libuv by default"
santigimeno Aug 8, 2024
a490bb8
src: remove uv__node_patch_is_using_io_uring
santigimeno Aug 8, 2024
8ceefeb
events: optimize EventTarget.addEventListener
ronag Oct 14, 2024
c028d21
diagnostics_channel: fix unsubscribe during publish
simon-id Oct 14, 2024
c5abf50
benchmark: adjust byte size for buffer-copy
RafaelGSS Oct 14, 2024
d9f0407
test_runner: require `--enable-source-maps` for sourcemap coverage
Oct 14, 2024
a9473bb
lib: remove settled dependant signals when they are GCed
geeksilva97 Oct 14, 2024
8b28222
deps: update c-ares to v1.34.1
nodejs-github-bot Oct 15, 2024
008fb5f
deps: patch V8 to 12.9.202.28
nodejs-github-bot Oct 15, 2024
57dbbf8
src: fix winapi_strerror error string
huseyinacacak-janea Oct 15, 2024
c3f2216
doc: add instructions for WinGet build
huseyinacacak-janea Oct 15, 2024
1ce8928
sqlite: cache column names in stmt.all()
indutny Oct 15, 2024
dd848f2
lib: test_runner#mock:timers respeced timeout_max behaviour
badkeyy Oct 15, 2024
3b2b3a8
tools: fix typos
NathanBaulch Oct 15, 2024
c05582d
buffer: make Buffer work with resizable ArrayBuffer
jasnell Oct 15, 2024
903863c
deps: update simdutf to 5.6.0
nodejs-github-bot Oct 15, 2024
22d7777
esm: fix inconsistency with `importAssertion` in `resolve` hook
yesmeck Oct 15, 2024
69ee56a
test_runner: add support for scheduler.wait on mock timers
ErickWendel Oct 15, 2024
e15f779
doc: spell out condition restrictions
jkrems Sep 30, 2024
1da4168
tools: add `polyfilled` option to `prefer-primordials` rule
aduh95 Oct 17, 2024
f48d30e
build: fix path concatenation
VoltrexKeyva Oct 17, 2024
b4b6ddb
dns: honor the order option
lpinca Oct 17, 2024
9b7b4a6
test: remove duplicate tests
lpinca Oct 17, 2024
db18aca
lib: add flag to drop connection when running in cluster mode
theanarkh Oct 17, 2024
0130780
meta: change color to blue notify review-wanted
RafaelGSS Oct 17, 2024
4ba31b7
assert: make assertion_error use Myers diff algorithm
puskin94 Oct 17, 2024
12d709b
meta: assign CODEOWNERS for /deps/ncrypto/*
panva Oct 17, 2024
97c6448
test_runner: mark mockTimers as stable
ErickWendel Oct 15, 2024
0be3a75
doc: add changelog for mocktimers
ErickWendel Oct 16, 2024
2967471
doc: move Beth Griggs keys to old gpg keys
RafaelGSS Oct 15, 2024
7d5bb09
doc: move Bryan English key to old gpg keys
RafaelGSS Oct 15, 2024
1ec25e8
doc: move Danielle Adams key to old gpg keys
RafaelGSS Oct 15, 2024
dd5a08d
test: update `console` wpt
Oct 18, 2024
d9494a7
fs: use `wstring` on Windows paths
jazelly Oct 6, 2024
7b3e38b
url: handle "unsafe" characters properly in `pathToFileURL`
aduh95 Oct 18, 2024
aca03d9
benchmark: add --runs support to run.js
RafaelGSS Oct 18, 2024
89c96ad
src: remove icu based `ToASCII` and `ToUnicode`
anonrig Oct 18, 2024
4e5c90b
lib: replace `createDeferredPromise` util with `Promise.withResolvers`
anonrig Oct 19, 2024
714f272
lib: remove startsWith/endsWith primordials for char checks
gurgunday Oct 19, 2024
adead26
crypto: include openssl/rand.h explicitly
codebytere Oct 19, 2024
1b63a82
test,crypto: update WebCryptoAPI WPT
panva Oct 19, 2024
0da1632
src,lib: introduce `util.getSystemErrorMessage(err)`
juanarbol Oct 19, 2024
52da293
cli: add `--heap-prof` flag available to `NODE_OPTIONS`
juanarbol Oct 20, 2024
a12dbf0
module: simplify ts under node_modules check
marco-ippolito Oct 20, 2024
65936a8
tools: add script to synch c-ares source lists
richardlau Oct 18, 2024
2beae50
build: synchronize list of c-ares source files
richardlau Oct 18, 2024
2147e49
build: tidy up cares.gyp
richardlau Oct 18, 2024
6f7379a
test: fix invalid `file:` URL in `test-fs-path-dir`
aduh95 Oct 21, 2024
9e32027
Revert "path: fix bugs and inconsistencies"
Oct 21, 2024
dcbc5fb
lib: add UV_UDP_REUSEPORT for udp
theanarkh Oct 21, 2024
ec867ac
net: add UV_TCP_REUSEPORT for tcp
theanarkh Oct 21, 2024
d54d3b2
meta: move one or more collaborators to emeritus
nodejs-github-bot Oct 21, 2024
c2b5ebf
deps: update ada to 2.9.1
nodejs-github-bot Oct 21, 2024
32f7d5a
build: conditionally compile bundled sqlite
richardlau Oct 21, 2024
8eb5359
build: fix uninstall script for AIX 7.1
cloorc Oct 21, 2024
784c825
doc: remove outdated remarks about `highWaterMark` in fs
isker Oct 22, 2024
45ef180
deps: update c-ares to v1.34.2
nodejs-github-bot Oct 22, 2024
bfc10a9
deps: update googletest to df1544b
nodejs-github-bot Oct 22, 2024
c10c671
test: deflake `test-cluster-shared-handle-bind-privileged-port`
Oct 22, 2024
689d3a3
doc: add `isBigIntObject` to documentation
leviscar Oct 22, 2024
04b41bd
doc: add note about stdio streams in child_process
Ed-roro Oct 22, 2024
cc775d3
src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2`
Oct 22, 2024
94e863c
test: update wpt test for webmessaging/broadcastchannel
Nahee-Park Oct 22, 2024
6c8564b
test: fix addons and node-api test assumptions
aduh95 Oct 22, 2024
736c085
typings: add missing type of `ArrayBufferPrototypeGetByteLength`
iwuliz Oct 22, 2024
45f960c
fs: pass correct path to `DirentFromStats` during `glob`
Oct 22, 2024
10f6b90
tools: update gyp-next to 0.18.3
nodejs-github-bot Oct 22, 2024
2ac2c5a
tools: update lint-md-dependencies
nodejs-github-bot Oct 22, 2024
8634e05
test: make test-node-output-v8-warning more flexible
codebytere Oct 22, 2024
bbd5318
esm: add a fallback when importer in not a file
aduh95 Oct 22, 2024
6764273
stream: propagate AbortSignal reason
marvinroger Oct 22, 2024
2c960a2
module: include module information in require(esm) warning
joyeecheung Oct 22, 2024
66bcf4c
doc: move dual package shipping docs to separate repo
joyeecheung Oct 22, 2024
194bb0f
build: fix GN build for cares/uv deps
zcbenz Oct 23, 2024
0f1d13e
lib: ensure FORCE_COLOR forces color output in non-TTY environments
pmarchini Oct 23, 2024
37352ce
doc: changed the command used to verify SHASUMS256
adriancuadrado Oct 23, 2024
df2f1ad
deps: V8: cherry-pick f915fa4c9f41
legendecas Oct 21, 2024
4dc2791
test: add repl preview timeout test
legendecas Oct 21, 2024
17fae65
2024-10-24, Version 23.1.0 (Current)
aduh95 Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
/lib/tls.js @nodejs/crypto @nodejs/net
/src/crypto/* @nodejs/crypto
/src/node_crypto* @nodejs/crypto
/deps/ncrypto/* @nodejs/crypto

# http

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-linux-without-intl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Clean tmp
run: rm -rf coverage/tmp && rm -rf out
- name: Upload
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
directory: ./coverage
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/coverage-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Clean tmp
run: rm -rf coverage/tmp && rm -rf out
- name: Upload
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
directory: ./coverage
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/coverage-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Clean tmp
run: npx rimraf ./coverage/tmp
- name: Upload
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
directory: ./coverage
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/notify-on-review-wanted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Slack Notification
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # 2.3.0
env:
SLACK_COLOR: '#DE512A'
SLACK_COLOR: '#3d85c6'
SLACK_ICON: https://github.com/nodejs.png?size=48
SLACK_TITLE: ${{ steps.define-message.outputs.title }}
SLACK_MESSAGE: ${{ steps.define-message.outputs.message }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand Down Expand Up @@ -73,6 +73,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
sarif_file: results.sarif
32 changes: 30 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ file a new issue.
* [Windows](#windows)
* [Windows Prerequisites](#windows-prerequisites)
* [Option 1: Manual install](#option-1-manual-install)
* [Option 2: Automated install with Boxstarter](#option-2-automated-install-with-boxstarter)
* [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget)
* [Option 3: Automated install with Boxstarter](#option-3-automated-install-with-boxstarter)
* [Building Node.js](#building-nodejs-2)
* [Android](#android)
* [`Intl` (ECMA-402) support](#intl-ecma-402-support)
Expand Down Expand Up @@ -666,7 +667,34 @@ Optional requirements for compiling with ClangCL:

NOTE: Currently we only support compiling with Clang that comes from Visual Studio.

##### Option 2: Automated install with Boxstarter
##### Option 2: Automated install with WinGet

[WinGet configuration files](https://github.com/nodejs/node/tree/main/.configurations)
can be used to install all the required prerequisites for Node.js development
easily. These files will install the following
[WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) packages:

* Git for Windows with the `git` and Unix tools added to the `PATH`
* `Python 3.12`
* `Visual Studio 2022` (Community, Enterprise or Professional)
* `Visual Studio 2022 Build Tools` with Visual C++ workload, Clang and ClangToolset
* `NetWide Assembler`

To install Node.js prerequisites from Powershell Terminal:

```powershell
winget configure .\configuration.dsc.yaml
```

Alternatively, you can use [Dev Home](https://learn.microsoft.com/en-us/windows/dev-home/)
to install the prerequisites:

* Switch to `Machine Configuration` tab
* Click on `Configuration File`
* Choose the corresponding WinGet configuration file
* Click on `Set up as admin`

##### Option 3: Automated install with Boxstarter

A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of
Windows systems with all the required prerequisites for Node.js development.
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ release.
<th title="LTS Until 2025-04"><a href="doc/changelogs/CHANGELOG_V18.md">18</a> (LTS)</th>
</tr>
<tr>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.0.0">23.0.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.1.0">23.1.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.0.0">23.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V22.md#22.9.0">22.9.0</a></b><br/>
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ coverage-clean: ## Remove coverage artifacts.
$(RM) -r coverage/tmp
@if [ -d "out/Release/obj.target" ]; then \
$(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \
-type f -exec $(RM) {};\
-type f | xargs $(RM); \
fi

.PHONY: coverage
Expand All @@ -269,7 +269,7 @@ coverage-build-js: ## Build JavaScript coverage files.
.PHONY: coverage-test
coverage-test: coverage-build ## Run the tests and generate a coverage report.
@if [ -d "out/Release/obj.target" ]; then \
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f -exec $(RM) {}; \
$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f | xargs $(RM); \
fi
-NODE_V8_COVERAGE=coverage/tmp \
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
Expand Down
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ To download `SHASUMS256.txt` using `curl`:
curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
```

To check that a downloaded file matches the checksum, run
it through `sha256sum` with a command such as:
To check that downloaded files match the checksum, use `sha256sum`:

```bash
grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
sha256sum -c SHASUMS256.txt --ignore-missing
```

For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in
Expand Down Expand Up @@ -320,8 +319,6 @@ For information about the governance of the Node.js project, see
**Kohei Ueno** <<[email protected]>> (he/him)
* [daeyeon](https://github.com/daeyeon) -
**Daeyeon Jeong** <<[email protected]>> (he/him)
* [danielleadams](https://github.com/danielleadams) -
**Danielle Adams** <<[email protected]>> (she/her)
* [debadree25](https://github.com/debadree25) -
**Debadree Chatterjee** <<[email protected]>> (he/him)
* [deokjinkim](https://github.com/deokjinkim) -
Expand Down Expand Up @@ -502,6 +499,8 @@ For information about the governance of the Node.js project, see
**Claudio Rodriguez** <<[email protected]>>
* [danbev](https://github.com/danbev) -
**Daniel Bevenius** <<[email protected]>> (he/him)
* [danielleadams](https://github.com/danielleadams) -
**Danielle Adams** <<[email protected]>> (she/her)
* [DavidCai1993](https://github.com/DavidCai1993) -
**David Cai** <<[email protected]>> (he/him)
* [davisjam](https://github.com/davisjam) -
Expand Down Expand Up @@ -770,12 +769,6 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):

* **Antoine du Hamel** <<[email protected]>>
`C0D6248439F1D5604AAFFB4021D900FFDB233756`
* **Beth Griggs** <<[email protected]>>
`4ED778F539E3634C779C87C6D7062848A1AB005C`
* **Bryan English** <<[email protected]>>
`141F07595B7B3FFE74309A937405533BE57C7D57`
* **Danielle Adams** <<[email protected]>>
`74F12602B6F1C4E913FAA37AD3A89613643B6201`
* **Juan José Arboleda** <<[email protected]>>
`DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7`
* **Marco Ippolito** <<[email protected]>>
Expand All @@ -796,9 +789,6 @@ to sign releases):

```bash
gpg --keyserver hkps://keys.openpgp.org --recv-keys C0D6248439F1D5604AAFFB4021D900FFDB233756 # Antoine du Hamel
gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C # Beth Griggs
gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 # Bryan English
gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 # Danielle Adams
gpg --keyserver hkps://keys.openpgp.org --recv-keys DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 # Juan José Arboleda
gpg --keyserver hkps://keys.openpgp.org --recv-keys CC68F5A3106FF448322E48ED27F5E38D5B0A215F # Marco Ippolito
gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 # Michaël Zasso
Expand All @@ -815,12 +805,17 @@ verify a downloaded file.

<summary>Other keys used to sign some previous releases</summary>

* **Beth Griggs** <<[email protected]>>
`4ED778F539E3634C779C87C6D7062848A1AB005C`
* **Bryan English** <<[email protected]>>
`141F07595B7B3FFE74309A937405533BE57C7D57`
* **Chris Dickinson** <<[email protected]>>
`9554F04D7259F04124DE6B476D5A82AC7E37093B`
* **Colin Ihrig** <<[email protected]>>
`94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
* **Danielle Adams** <<[email protected]>>
`1C050899334244A8AF75E53792EF661D867B9DFA`
`74F12602B6F1C4E913FAA37AD3A89613643B6201`
* **Evan Lucas** <<[email protected]>>
`B9AE9905FFD7803F25714661B63B535A4C206CA9`
* **Gibson Fahnestock** <<[email protected]>>
Expand Down
12 changes: 4 additions & 8 deletions benchmark/assert/deepequal-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ const common = require('../common.js');
const assert = require('assert');

const bench = common.createBenchmark(main, {
n: [25, 2e2, 2e3],
size: [1e2, 1e3, 1e4],
strict: [1],
method: ['deepEqual', 'notDeepEqual'],
n: [25, 2e2],
size: [1e2, 1e4],
method: ['deepEqual', 'notDeepEqual', 'deepStrictEqual', 'notDeepStrictEqual'],
}, {
combinationFilter: (p) => {
return p.size === 1e4 && p.n === 25 ||
Expand All @@ -30,10 +29,7 @@ function createObj(size, add = '') {
}));
}

function main({ size, n, method, strict }) {
if (strict) {
method = method.replace('eep', 'eepStrict');
}
function main({ size, n, method }) {
const fn = assert[method];

const actual = createObj(size);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const common = require('../common.js');

const bench = common.createBenchmark(main, {
bytes: [0, 8, 128, 32 * 1024],
bytes: [8, 128, 1024],
partial: ['true', 'false'],
n: [6e6],
});
Expand Down
25 changes: 25 additions & 0 deletions benchmark/events/eventtarget-add-remove-abort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';
const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1e5],
nListener: [1, 5, 10],
});

function main({ n, nListener }) {
const target = new EventTarget();
const listeners = [];
for (let k = 0; k < nListener; k += 1)
listeners.push(() => {});

bench.start();
for (let i = 0; i < n; i += 1) {
for (let k = listeners.length; --k >= 0;) {
target.addEventListener('abort', listeners[k]);
}
for (let k = listeners.length; --k >= 0;) {
target.removeEventListener('abort', listeners[k]);
}
}
bench.end(n);
}
4 changes: 2 additions & 2 deletions benchmark/events/eventtarget-add-remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1e6],
nListener: [5, 10],
n: [1e5],
nListener: [1, 5, 10],
});

function main({ n, nListener }) {
Expand Down
83 changes: 47 additions & 36 deletions benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const cli = new CLI(`usage: ./node run.js [options] [--] <category> ...
(can be repeated)
--exclude pattern excludes scripts matching <pattern> (can be
repeated)
--runs variable=value set the amount of benchmark suite execution.
Default: 1
--set variable=value set benchmark variable (can be repeated)
--format [simple|csv] optional value that specifies the output format
test only run a single configuration from the options
Expand Down Expand Up @@ -45,8 +47,7 @@ if (format === 'csv') {
console.log('"filename", "configuration", "rate", "time"');
}

(function recursive(i) {
const filename = benchmarks[i];
function runBenchmark(filename) {
const scriptPath = path.resolve(__dirname, filename);

const args = cli.test ? ['--test'] : cli.optional.set;
Expand All @@ -63,42 +64,52 @@ if (format === 'csv') {
);
}

if (format !== 'csv') {
console.log();
console.log(filename);
}

child.on('message', (data) => {
if (data.type !== 'report') {
return;
}
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
if (conf !== '')
conf += ' ';
conf += `${key}=${JSON.stringify(data.conf[key])}`;
}
if (format === 'csv') {
// Escape quotes (") for correct csv formatting
conf = conf.replace(/"/g, '""');
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
} else {
let rate = data.rate.toString().split('.');
rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
rate = (rate[1] ? rate.join('.') : rate[0]);
console.log(`${data.name} ${conf}: ${rate}`);
}
return new Promise((resolve, reject) => {
child.on('message', (data) => {
if (data.type !== 'report') {
return;
}
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
if (conf !== '')
conf += ' ';
conf += `${key}=${JSON.stringify(data.conf[key])}`;
}
if (format === 'csv') {
// Escape quotes (") for correct csv formatting
conf = conf.replace(/"/g, '""');
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
} else {
let rate = data.rate.toString().split('.');
rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
rate = (rate[1] ? rate.join('.') : rate[0]);
console.log(`${data.name} ${conf}: ${rate}`);
}
});
child.once('close', (code) => {
if (code) {
reject(code);
} else {
resolve(code);
}
});
});
}

child.once('close', (code) => {
if (code) {
process.exit(code);
async function run() {
for (let i = 0; i < benchmarks.length; ++i) {
let runs = cli.optional.runs ?? 1;
const filename = benchmarks[i];
if (format !== 'csv') {
console.log();
console.log(filename);
}

// If there are more benchmarks execute the next
if (i + 1 < benchmarks.length) {
recursive(i + 1);
while (runs-- > 0) {
await runBenchmark(filename);
}
});
})(0);
}
}

run();
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.10',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
Loading
Loading