node/benchmark
Guilherme Araújo 5a1f67c27b
util: create hex style cache and fast path
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62999
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-05-30 19:26:27 +02:00
..
abort_controller benchmark: add AbortSignal.abort benchmarks 2024-04-10 20:16:04 +00:00
assert assert,util: handle invalid dates as equal in deep comparison 2025-06-21 04:00:23 +00:00
async_hooks lib: rewrite AsyncLocalStorage without async_hooks 2024-08-02 19:44:20 +00:00
blob benchmark: reduce the buffer size for blob 2024-04-17 19:33:44 +00:00
buffers buffer: improve performance of multiple Buffer operations 2026-03-27 21:50:58 +00:00
child_process
cluster benchmark: calibrate config cluster/echo.js 2025-09-12 12:59:37 +00:00
console console: optimize single-string logging 2025-11-02 23:33:58 +00:00
crypto crypto: wire ML-DSA and ML-KEM for use when using BoringSSL 2026-05-19 14:08:25 +02:00
dgram benchmark: fix destructuring in dgram/single-buffer 2026-03-16 18:16:39 +00:00
diagnostics_channel benchmark: reduce N for diagnostics_channel subscribe benchmark 2025-07-20 20:45:00 +00:00
dns
domain
error
es benchmark: remove deprecated _extend from benchmark 2025-08-11 15:42:46 +00:00
esm benchmark: use typescript for import cjs benchmark 2025-11-12 18:34:59 +00:00
events events: optimize EventTarget.addEventListener 2024-10-14 10:24:32 +00:00
ffi ffi: add shared-buffer fast path for numeric and pointer signatures 2026-05-05 16:19:54 +02:00
fixtures module: remove --experimental-transform-types 2026-02-27 16:32:43 +00:00
fs src: dispatch ToV8Value(string_view) via StringBytes::Encode 2026-05-30 19:26:25 +02:00
http http: implement slab allocation for HTTP header parsing 2026-02-04 14:11:00 +00:00
http2
https
internal lib,src: isInsideNodeModules should test on the first non-internal frame 2025-12-10 13:59:35 +00:00
mime
misc lib: refactor internal webidl converters 2026-05-05 16:21:27 +02:00
module benchmark: add per-suite setup option 2025-11-07 17:47:43 +00:00
napi node-api: fix node_api_create_object_with_properties name 2026-01-23 03:51:23 +00:00
net
os os: improve tmpdir performance 2024-09-11 14:46:30 +00:00
path path: improve path.resolve() performance when used as process.cwd() 2025-05-19 13:23:57 +00:00
perf_hooks benchmark: add nodeTiming.uvmetricsinfo bench 2024-11-01 13:35:15 -03:00
permission benchmark: update count to n in permission startup 2025-09-24 20:33:10 +00:00
process process: optimize asyncHandledRejections by using FixedQueue 2026-01-02 11:40:05 +00:00
querystring
readline
source_map benchmark: add source map and source map cache 2025-07-07 15:53:35 +00:00
sqlite benchmark: add SQLite benchmarks 2026-01-23 19:14:29 +01:00
streams stream: use data listener for compose forwarding 2026-05-30 19:26:26 +02:00
string_decoder benchmark: adjust configuration for string-decoder bench 2025-07-25 20:49:56 +00:00
test_runner test_runner: run single test file benchmark 2025-01-09 11:12:12 +00:00
timers
tls tls: remove deprecated tls.createSecurePair 2025-03-11 23:01:28 +00:00
ts module: remove --experimental-transform-types 2026-02-27 16:32:43 +00:00
url url: optimize URLSearchParams set/delete duplicate handling 2026-05-05 16:19:38 +02:00
util util: create hex style cache and fast path 2026-05-30 19:26:27 +02:00
v8 lib: avoid quadratic shift() in startup snapshot callback 2026-05-05 16:19:40 +02:00
validators
vm benchmark: add benchmark for leaf source text modules 2025-10-18 08:20:47 +00:00
websocket
webstorage src: unflag --experimental-webstorage by default 2025-09-25 11:59:58 +00:00
webstreams stream: add fast paths for webstreams read and pipeTo 2026-02-19 21:53:46 +00:00
worker
zlib zlib: implement fast path for crc32 2025-09-14 00:39:58 +00:00
_benchmark_progress.js
_cli.js benchmark: small lint fix on _cli.js 2025-07-24 17:17:52 +00:00
_cli.R
_http-benchmarkers.js lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
_test-double-benchmarker.js
bar.R
calibrate-n.js benchmark: add calibrate-n script 2025-07-29 18:49:55 +00:00
common.js benchmark: allow boolean option values 2025-12-25 10:45:06 +00:00
compare.js benchmark: inherit stdio/stderr instead of pipe 2024-04-13 18:01:28 +00:00
compare.R
cpu.sh benchmark: improve cpu.sh for safety and usability 2025-10-27 14:10:27 +00:00
eslint.config_partial.mjs tools: import rather than require ESLint plugins 2025-03-07 14:52:52 +00:00
README.md benchmark,doc: mention bar.R to the list of scripts 2024-09-04 18:53:02 +00:00
run.js benchmark: add --track to benchmark 2025-07-25 13:22:26 +00:00
scatter.js
scatter.R

Node.js Core Benchmarks

This folder contains code and data used to measure performance of different Node.js implementations and different ways of writing JavaScript run by the built-in JavaScript engine.

For a detailed guide on how to write and run benchmarks in this directory, see the guide on benchmarks.

Table of Contents

File tree structure

Directories

Benchmarks testing the performance of a single node submodule are placed into a directory with the corresponding name, so that they can be executed by submodule or individually. Benchmarks that span multiple submodules may either be placed into the misc directory or into a directory named after the feature they benchmark. E.g. benchmarks for various new ECMAScript features and their pre-ES2015 counterparts are placed in a directory named es. Fixtures that are not specific to a certain benchmark but can be reused throughout the benchmark suite should be placed in the fixtures directory.

Other Top-level files

The top-level files include common dependencies of the benchmarks and the tools for launching benchmarks and visualizing their output. The actual benchmark scripts should be placed in their corresponding directories.

  • _benchmark_progress.js: implements the progress bar displayed when running compare.js
  • _cli.js: parses the command line arguments passed to compare.js, run.js and scatter.js
  • _cli.R: parses the command line arguments passed to compare.R
  • _http-benchmarkers.js: selects and runs external tools for benchmarking the http subsystem.
  • bar.R: R script for visualizing the output of benchmarks with bar plots.
  • common.js: see Common API.
  • compare.js: command line tool for comparing performance between different Node.js binaries.
  • compare.R: R script for statistically analyzing the output of compare.js
  • run.js: command line tool for running individual benchmark suite(s).
  • scatter.js: command line tool for comparing the performance between different parameters in benchmark configurations, for example to analyze the time complexity.
  • scatter.R: R script for visualizing the output of scatter.js with scatter plots.

Common API

The common.js module is used by benchmarks for consistency across repeated tasks. It has a number of helpful functions and properties to help with writing benchmarks.

createBenchmark(fn, configs[, options])

See the guide on writing benchmarks.

default_http_benchmarker

The default benchmarker used to run HTTP benchmarks. See the guide on writing HTTP benchmarks.

PORT

The default port used to run HTTP benchmarks. See the guide on writing HTTP benchmarks.

sendResult(data)

Used in special benchmarks that can't use createBenchmark and the object it returns to accomplish what they need. This function reports timing data to the parent process (usually created by running compare.js, run.js or scatter.js).