-26.13.1
+26.14.0
+26.13.1
26.13.0
26.12.1
26.12.0
diff --git a/Makefile b/Makefile
index 15de4409eb35..28a8789e8de2 100644
--- a/Makefile
+++ b/Makefile
@@ -349,7 +349,7 @@ TRACE_PROCESSOR_SHELL_DEPS = deps/perfetto/VERSION
endif
$(TRACE_PROCESSOR_SHELL_PATH): $(TRACE_PROCESSOR_SHELL_DEPS)
- @tools/perfetto/get_trace_processor $@
+ @$(PYTHON) tools/perfetto/get_trace_processor.py $@
.PHONY: test
# This does not run tests of third-party libraries inside deps.
@@ -992,7 +992,7 @@ ifndef DISTTYPE
DISTTYPE=release
endif
ifeq ($(DISTTYPE),release)
-FULLVERSION=$(VERSION)
+FULLVERSION=v$(shell $(PYTHON) tools/getnodeversion.py --full)
else # ifeq ($(DISTTYPE),release)
ifeq ($(DISTTYPE),custom)
ifndef CUSTOMTAG
@@ -1271,7 +1271,7 @@ endif
--resources $(MACOSOUTDIR)/installer/productbuild/Resources \
--package-path $(MACOSOUTDIR)/pkgs ./$(PKG)
SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" sh tools/osx-productsign.sh
- sh tools/osx-notarize.sh $(FULLVERSION)
+ sh tools/osx-notarize.sh $(PKG)
.PHONY: pkg
pkg: $(PKG) ## Build the macOS installer for releases.
@@ -1363,8 +1363,8 @@ endif
$(RM) -r $(TARNAME)/tools/eslint/node_modules
$(RM) -r $(TARNAME)/tools/osx-*
$(RM) -r $(TARNAME)/tools/osx-pkg.pmdoc
- find $(TARNAME)/deps/v8/test/* -type d ! -regex '.*/test/torque$$' | xargs $(RM) -r
- find $(TARNAME)/deps/v8/test -type f ! -regex '.*/test/torque/.*' | xargs $(RM)
+ find $(TARNAME)/deps/v8/test/* -type d ! -regex '.*/test/torque$$' ! -regex '.*/test/mkgrokdump$$' | xargs $(RM) -r
+ find $(TARNAME)/deps/v8/test -type f ! -regex '.*/test/torque/.*' ! -regex '.*/test/mkgrokdump/.*' | xargs $(RM)
find $(TARNAME)/deps/zlib/contrib/* -type d ! -regex '.*/contrib/optimizations$$' | xargs $(RM) -r
find $(TARNAME)/ -name "eslint.config*" -maxdepth 2 | xargs $(RM)
find $(TARNAME)/ -type l | xargs $(RM)
@@ -1457,6 +1457,7 @@ else
endif
ifeq ($(OSTYPE),darwin)
SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" sh tools/osx-codesign.sh
+ sh tools/osx-notarize.sh $(BINARYNAME)/bin/node
endif
tar -cf $(BINARYNAME).tar $(BINARYNAME)
$(RM) -r $(BINARYNAME)
@@ -1499,10 +1500,11 @@ bench-addons-clean:
$(RM) -r benchmark/napi/*/build
$(RM) benchmark/napi/.buildstamp
-ifeq ("$(wildcard tools/.mdlintstamp)","")
-LINT_MD_NEWER =
-else
+# Recheck all Markdown when the lint dependencies change.
+ifeq ($(shell test tools/.mdlintstamp -nt tools/lint-md/package-lock.json && echo 1),1)
LINT_MD_NEWER = -newer tools/.mdlintstamp
+else
+LINT_MD_NEWER =
endif
LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md,$(wildcard *.md))
@@ -1512,7 +1514,7 @@ LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
run-lint-md = tools/lint-md/lint-md.mjs $(LINT_MD_FILES)
# Check for a specific file, as (empty) directories are persisted in git.
-tools/lint-md/node_modules/remark-parse/package.json:
+tools/lint-md/node_modules/remark-parse/package.json: tools/lint-md/package-lock.json
-cd tools/lint-md && $(call available-node,$(run-npm-ci))
# Lint all changed markdown files maintained by us
@@ -1738,15 +1740,17 @@ endif
# python -m pip install yamllint
# Try with '--system' if it fails without; the system may have set '--user'
lint-yaml-build: ## Build resources needed to lint YAML files.
+ifeq ($(YAMLLINT), tools/pip/site-packages/bin/yamllint)
$(info Pip installing yamllint on $(shell $(PYTHON) --version)...)
$(PYTHON) -m pip install --upgrade -t tools/pip/site-packages yamllint || \
$(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages yamllint
+endif
.PHONY: lint-yaml
ifneq ("","$(wildcard $(YAMLLINT))")
lint-yaml: ## Lint the YAML files with yamllint.
$(info Running YAML linter...)
- PYTHONPATH=tools/pip $(YAMLLINT) .
+ PYTHONPATH=tools/pip $(YAMLLINT) --strict .
else
lint-yaml:
$(warning YAML linting with yamllint is not available)
diff --git a/README.md b/README.md
index d14fba943dd0..5d1de80e7aa2 100644
--- a/README.md
+++ b/README.md
@@ -309,6 +309,8 @@ For information about the governance of the Node.js project, see
**Christian Clauss** <> (he/him)
* [ChALkeR](https://github.com/ChALkeR) -
**Сковорода Никита Андреевич** <> (he/him)
+* [christianaurichzm](https://github.com/christianaurichzm) -
+ **Christian Aurich Zanettini Martins** <> (he/him)
* [cjihrig](https://github.com/cjihrig) -
**Colin Ihrig** <> (he/him)
* [codebytere](https://github.com/codebytere) -
@@ -321,6 +323,8 @@ For information about the governance of the Node.js project, see
**Dario Piotrowicz** <> (he/him)
* [deokjinkim](https://github.com/deokjinkim) -
**Deokjin Kim** <> (he/him)
+* [efekrskl](https://github.com/efekrskl) -
+ **Efe Karasakal** <> (he/him)
* [ErickWendel](https://github.com/ErickWendel) -
**Erick Wendel** <> (he/him)
* [Ethan-Arrowood](https://github.com/Ethan-Arrowood) -
@@ -403,6 +407,8 @@ For information about the governance of the Node.js project, see
**Filip Skokan** <> (he/him) - [Support me](https://github.com/sponsors/panva)
* [pimterry](https://github.com/pimterry) -
**Tim Perry** <> (he/him)
+* [pipobscure](https://github.com/pipobscure) -
+ **Philipp Dunkel** <> (he/him)
* [pmarchini](https://github.com/pmarchini) -
**Pietro Marchini** <> (he/him)
* [Qard](https://github.com/Qard) -
@@ -761,6 +767,8 @@ maintaining the Node.js project.
**Haram Jeong** <>
* [HBSPS](https://github.com/HBSPS) -
**Wiyeong Seo** <>
+* [HoonDongKang](https://github.com/HoonDongKang) -
+ **Donghoon Kang** <>
* [iam-frankqiu](https://github.com/iam-frankqiu) -
**Frank Qiu** <> (he/him)
* [inoway46](https://github.com/inoway46) -
diff --git a/benchmark/abort_controller/abort-controller-abort.js b/benchmark/abort_controller/abort-controller-abort.js
new file mode 100644
index 000000000000..c1c97718f82e
--- /dev/null
+++ b/benchmark/abort_controller/abort-controller-abort.js
@@ -0,0 +1,21 @@
+'use strict';
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ n: [1e6],
+ listeners: [0, 1],
+});
+
+function main({ n, listeners }) {
+ const reason = new Error('reason');
+ const noop = () => {};
+
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ const ac = new AbortController();
+ if (listeners > 0)
+ ac.signal.addEventListener('abort', noop);
+ ac.abort(reason);
+ }
+ bench.end(n);
+}
diff --git a/benchmark/abort_controller/abort-signal-add-remove.js b/benchmark/abort_controller/abort-signal-add-remove.js
new file mode 100644
index 000000000000..77a5216f2388
--- /dev/null
+++ b/benchmark/abort_controller/abort-signal-add-remove.js
@@ -0,0 +1,43 @@
+'use strict';
+const common = require('../common.js');
+const { addAbortListener } = require('events');
+
+const bench = common.createBenchmark(main, {
+ n: [1e6],
+ kind: ['addEventListener', 'addEventListener-once', 'addAbortListener'],
+});
+
+function main({ n, kind }) {
+ const { signal } = new AbortController();
+ const noop = () => {};
+
+ switch (kind) {
+ case 'addEventListener':
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ signal.addEventListener('abort', noop);
+ signal.removeEventListener('abort', noop);
+ }
+ bench.end(n);
+ break;
+ case 'addEventListener-once': {
+ const options = { once: true };
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ signal.addEventListener('abort', noop, options);
+ signal.removeEventListener('abort', noop);
+ }
+ bench.end(n);
+ break;
+ }
+ case 'addAbortListener':
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ addAbortListener(signal, noop)[Symbol.dispose]();
+ }
+ bench.end(n);
+ break;
+ default:
+ throw new Error('Invalid kind');
+ }
+}
diff --git a/benchmark/abort_controller/abort-signal-any.js b/benchmark/abort_controller/abort-signal-any.js
new file mode 100644
index 000000000000..96981067e50d
--- /dev/null
+++ b/benchmark/abort_controller/abort-signal-any.js
@@ -0,0 +1,46 @@
+'use strict';
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ n: [2e5],
+ kind: ['create', 'listen', 'abort'],
+});
+
+// Combines a per-iteration signal with a long-lived one, like a request
+// signal combined with a server wide one. The work is split into batches
+// that run in separate macrotasks because WeakRef targets are kept alive
+// until the end of the current job, as they would be between requests.
+function main({ n, kind }) {
+ const reason = new Error('reason');
+ const noop = () => {};
+ const longLived = new AbortController().signal;
+ const batch = 1000;
+
+ function run(count) {
+ for (let i = 0; i < count; i++) {
+ const ac = new AbortController();
+ const signal = AbortSignal.any([ac.signal, longLived]);
+ if (kind === 'create')
+ continue;
+ signal.addEventListener('abort', noop, { once: true });
+ if (kind === 'listen')
+ signal.removeEventListener('abort', noop);
+ else
+ ac.abort(reason);
+ }
+ }
+
+ let left = n;
+ function step() {
+ const count = Math.min(batch, left);
+ run(count);
+ left -= count;
+ if (left > 0)
+ setImmediate(step);
+ else
+ bench.end(n);
+ }
+
+ bench.start();
+ step();
+}
diff --git a/benchmark/async_hooks/async-resource-vs-destroy.js b/benchmark/async_hooks/async-resource-vs-destroy.js
index 3bd9dd56934e..50085ddcf8a7 100644
--- a/benchmark/async_hooks/async-resource-vs-destroy.js
+++ b/benchmark/async_hooks/async-resource-vs-destroy.js
@@ -19,7 +19,6 @@ const bench = common.createBenchmark(main, {
path: '/',
connections: 500,
duration: 5,
- n: [1e6],
});
function buildCurrentResource(getServe) {
diff --git a/benchmark/error/hidestackframes-noerr.js b/benchmark/error/hidestackframes-noerr.js
index 9e662f6a620f..7a2eb85e16c8 100644
--- a/benchmark/error/hidestackframes-noerr.js
+++ b/benchmark/error/hidestackframes-noerr.js
@@ -29,11 +29,11 @@ function main({ n, type }) {
const hideStackFramesTestfn = hideStackFrames((value) => {
if (typeof value !== 'number') {
- throw new ERR_INVALID_ARG_TYPE.HideStackFrameError('Benchmark', 'number', value);
+ throw new ERR_INVALID_ARG_TYPE.HideStackFramesError('Benchmark', 'number', value);
}
});
- const fn = type === 'hide-stackframe' ? hideStackFramesTestfn : testfn;
+ const fn = type === 'hide-stackframes' ? hideStackFramesTestfn : testfn;
const value = 42;
diff --git a/benchmark/error/hidestackframes-throw.js b/benchmark/error/hidestackframes-throw.js
index c7147e39ba57..8610bb9c44a8 100644
--- a/benchmark/error/hidestackframes-throw.js
+++ b/benchmark/error/hidestackframes-throw.js
@@ -32,7 +32,7 @@ function main({ n, type, double }) {
const hideStackFramesTestfn = hideStackFrames((value) => {
if (typeof value !== 'number') {
- throw new ERR_INVALID_ARG_TYPE.HideStackFrameError('Benchmark', 'number', value);
+ throw new ERR_INVALID_ARG_TYPE.HideStackFramesError('Benchmark', 'number', value);
}
});
@@ -44,7 +44,7 @@ function main({ n, type, double }) {
hideStackFramesTestfn.withoutStackTrace(value);
});
- const fn = type === 'hide-stackframe' ?
+ const fn = type === 'hide-stackframes' ?
double === 'true' ?
doubleHideStackFramesTestfn :
hideStackFramesTestfn :
diff --git a/benchmark/eslint.config_partial.mjs b/benchmark/eslint.config_partial.mjs
index 7f10460f7197..47ef14673908 100644
--- a/benchmark/eslint.config_partial.mjs
+++ b/benchmark/eslint.config_partial.mjs
@@ -9,6 +9,7 @@ export default [
},
},
rules: {
+ 'node-core/benchmark-n-config': 'error',
'prefer-arrow-callback': 'error',
},
},
diff --git a/benchmark/esm/startup-esm-graph.js b/benchmark/esm/startup-esm-graph.js
new file mode 100644
index 000000000000..7684ba67f6a6
--- /dev/null
+++ b/benchmark/esm/startup-esm-graph.js
@@ -0,0 +1,66 @@
+'use strict';
+
+const common = require('../common.js');
+const fs = require('fs');
+const path = require('path');
+const { pathToFileURL } = require('url');
+const tmpdir = require('../../test/common/tmpdir');
+
+const BRANCHING_FACTOR = 10;
+const benchmarkDirectory = tmpdir.resolve('esm-graph');
+
+// Each measured iteration has to load a graph the ESM cache has never seen, so the
+// fixture holds one independent copy of the graph per iteration.
+function graphDirectory(modules, copy) {
+ return path.join(benchmarkDirectory, `g${modules}-${copy}`);
+}
+
+function entryURL(modules, copy) {
+ return pathToFileURL(path.join(graphDirectory(modules, copy), 'mod0.mjs')).href;
+}
+
+// Build a complete BRANCHING_FACTOR-ary tree of `modules` + 1 modules rooted at mod0:
+// module i imports modules BRANCHING_FACTOR*i+1 through BRANCHING_FACTOR*i+BRANCHING_FACTOR,
+// capped at the total, so the shape approximates a real dependency tree rather than
+// one module with hundreds of direct imports.
+function createGraph(modules, copy) {
+ const dir = graphDirectory(modules, copy);
+ fs.mkdirSync(dir, { recursive: true });
+ const total = modules + 1;
+ for (let i = 0; i < total; i++) {
+ let source = '';
+ for (let c = 1; c <= BRANCHING_FACTOR; c++) {
+ const child = BRANCHING_FACTOR * i + c;
+ if (child < total) {
+ source += `import './mod${child}.mjs';\n`;
+ }
+ }
+ source += `export const value${i} = ${i};\n`;
+ fs.writeFileSync(path.join(dir, `mod${i}.mjs`), source);
+ }
+}
+
+const bench = common.createBenchmark(main, {
+ modules: [250, 500, 1000, 2000],
+ n: [10],
+}, {
+ setup(configs) {
+ // Build every fixture once here rather than per configuration: writing tens of
+ // thousands of files is far more expensive than the work being measured.
+ tmpdir.refresh();
+ const maxN = configs.reduce((max, c) => Math.max(max, c.n), 0);
+ for (const modules of new Set(configs.map((c) => c.modules))) {
+ for (let copy = 0; copy < maxN; copy++) {
+ createGraph(modules, copy);
+ }
+ }
+ },
+});
+
+async function main({ n, modules }) {
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ await import(entryURL(modules, i));
+ }
+ bench.end(n);
+}
diff --git a/benchmark/ffi/get-function-cache-miss.js b/benchmark/ffi/get-function-cache-miss.js
new file mode 100644
index 000000000000..9cb559c6ecb7
--- /dev/null
+++ b/benchmark/ffi/get-function-cache-miss.js
@@ -0,0 +1,48 @@
+'use strict';
+
+// Measures the first getFunction() call on each library instance. This includes
+// symbol resolution, signature preparation, and callable creation.
+// The `fast` variant is eligible for a generated trampoline on supported
+// platforms; `slow` exceeds the x86_64 register budget and falls back.
+// Library construction and closing are outside the measured region.
+
+const common = require('../common.js');
+const { DynamicLibrary } = require('node:ffi');
+const { libraryPath, ensureFixtureLibrary } = require('./common.js');
+
+const bench = common.createBenchmark(main, {
+ signature: ['fast', 'slow'],
+ n: [1e3],
+});
+
+ensureFixtureLibrary();
+
+const signatures = {
+ fast: { name: 'add_i32', return: 'i32', arguments: ['i32', 'i32'] },
+ slow: {
+ name: 'sum_8_i32',
+ return: 'i32',
+ arguments: ['i32', 'i32', 'i32', 'i32', 'i32', 'i32', 'i32', 'i32'],
+ },
+};
+
+function main({ n, signature }) {
+ const { name, ...definition } = signatures[signature];
+
+ // Warm up one-time initialization without populating the measured caches.
+ const warmup = new DynamicLibrary(libraryPath);
+ warmup.getFunction(name, definition);
+ warmup.close();
+
+ // Each instance has its own cache, so its first lookup creates a callable.
+ const libraries = Array.from({ length: n }, () => new DynamicLibrary(libraryPath));
+ const functions = new Array(n);
+
+ bench.start();
+ for (let i = 0; i < n; ++i)
+ functions[i] = libraries[i].getFunction(name, definition);
+ bench.end(n);
+
+ for (const lib of libraries)
+ lib.close();
+}
diff --git a/benchmark/ffi/get-function.js b/benchmark/ffi/get-function.js
index 939c1630ab64..7b885f1c6bdf 100644
--- a/benchmark/ffi/get-function.js
+++ b/benchmark/ffi/get-function.js
@@ -1,13 +1,9 @@
'use strict';
-// Measures symbol resolution rather than call throughput. Creating a callable
-// for a fast-eligible signature emits a native trampoline, so this benchmark
-// covers the trampoline allocation path that the call benchmarks never reach.
-//
-// The `fast` variant is eligible for a generated trampoline; `slow` exceeds the
-// x86_64 register budget and falls back, so it resolves without allocating one.
-// Comparing the two isolates trampoline creation cost from the rest of symbol
-// resolution.
+// Measures repeated getFunction() calls with a cached callable rather than
+// call throughput. The warmup populates the cache for the measured symbol.
+// See get-function-cache-miss.js for first-time resolution, including trampoline
+// creation for fast-eligible signatures on supported platforms.
const common = require('../common.js');
const { DynamicLibrary } = require('node:ffi');
@@ -33,8 +29,7 @@ function main({ n, signature }) {
const { name, ...definition } = signatures[signature];
const lib = new DynamicLibrary(libraryPath);
- // Warm up one-time initialization (libffi setup, executable memory probe) so
- // it is not attributed to the measured resolutions.
+ // Populate the callable cache before measuring repeated lookups.
lib.getFunction(name, definition);
bench.start();
diff --git a/benchmark/http/bench-parser-chunked.js b/benchmark/http/bench-parser-chunked.js
new file mode 100644
index 000000000000..782d95ea58d2
--- /dev/null
+++ b/benchmark/http/bench-parser-chunked.js
@@ -0,0 +1,55 @@
+'use strict';
+
+// Measures parsing a chunked request body as the chunk size shrinks.
+// The wire buffer is fed to the parser in 64 KiB slices, like socket reads.
+
+const common = require('../common');
+
+const bench = common.createBenchmark(main, {
+ chunkSize: [1, 16, 256, 4096],
+ len: [64 * 1024],
+ n: [500],
+}, {
+ flags: ['--expose-internals', '--no-warnings'],
+});
+
+function main({ chunkSize, len, n }) {
+ const { HTTPParser } = common.binding('http_parser');
+ const REQUEST = HTTPParser.REQUEST;
+ const kOnHeaders = HTTPParser.kOnHeaders | 0;
+ const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
+ const kOnBody = HTTPParser.kOnBody | 0;
+ const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
+ const kMaxHeaderPairs = 2000;
+ const kReadSize = 64 * 1024;
+
+ const chunk = `${chunkSize.toString(16)}\r\n${'x'.repeat(chunkSize)}\r\n`;
+ const wire = Buffer.from(
+ 'POST / HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\n\r\n' +
+ chunk.repeat(Math.ceil(len / chunkSize)) +
+ '0\r\n\r\n');
+
+ const reads = [];
+ for (let i = 0; i < wire.length; i += kReadSize)
+ reads.push(wire.subarray(i, i + kReadSize));
+
+ let bodyBytes = 0;
+ const parser = new HTTPParser();
+ parser.initialize(REQUEST, {}, 0, 0, undefined, kMaxHeaderPairs);
+ parser[kOnHeaders] = function() {};
+ parser[kOnHeadersComplete] = function() {};
+ parser[kOnBody] = function(b) { bodyBytes += b.length; };
+ parser[kOnMessageComplete] = function() {};
+
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ for (const read of reads)
+ parser.execute(read);
+ parser.initialize(REQUEST, {}, 0, 0, undefined, kMaxHeaderPairs);
+ }
+ bench.end(n);
+
+ const expected = Math.ceil(len / chunkSize) * chunkSize * n;
+ if (bodyBytes !== expected)
+ throw new Error(`Expected ${expected} body bytes, got ${bodyBytes}`);
+}
diff --git a/benchmark/napi/make_callback/binding.cc b/benchmark/napi/make_callback/binding.cc
index 85d335170fb0..3a793b6c1902 100644
--- a/benchmark/napi/make_callback/binding.cc
+++ b/benchmark/napi/make_callback/binding.cc
@@ -12,12 +12,19 @@ using v8::Local;
using v8::Object;
using v8::Value;
+// Same order as the types in index.js.
+enum Type { kMakeCallback, kAsyncResource, kCall };
+
struct State {
uv_timer_t timer;
Isolate* isolate;
int64_t n;
+ Type type;
Global fn;
Global done;
+ node::AsyncResource* resource = nullptr;
+
+ ~State() { delete resource; }
};
static void OnTimer(uv_timer_t* handle) {
@@ -30,7 +37,17 @@ static void OnTimer(uv_timer_t* handle) {
Local |