• Home
Name Date Size #Lines LOC

..--

assert/07-Sep-2024-455398

async_hooks/07-Sep-2024-552438

blob/07-Sep-2024-6657

buffers/07-Sep-2024-1,3571,127

child_process/07-Sep-2024-272232

cluster/07-Sep-2024-7667

crypto/07-Sep-2024-1,032862

dgram/07-Sep-2024-281211

diagnostics_channel/07-Sep-2024-147121

dns/07-Sep-2024-6859

domain/07-Sep-2024-3427

error/07-Sep-2024-3729

es/07-Sep-2024-709610

esm/07-Sep-2024-137101

events/07-Sep-2024-309258

fixtures/07-Sep-2024-4,2913,334

fs/07-Sep-2024-831656

http/07-Sep-2024-820670

http2/07-Sep-2024-215186

https/07-Sep-2024-3026

misc/07-Sep-2024-550450

module/07-Sep-2024-227183

napi/07-Sep-2024-1,102889

net/07-Sep-2024-950732

os/07-Sep-2024-4836

path/07-Sep-2024-590517

perf_hooks/07-Sep-2024-178152

policy/07-Sep-2024-5240

process/07-Sep-2024-517437

querystring/07-Sep-2024-10587

streams/07-Sep-2024-402321

string_decoder/07-Sep-2024-10490

test_runner/07-Sep-2024-160125

timers/07-Sep-2024-530410

tls/07-Sep-2024-380332

url/07-Sep-2024-842723

util/07-Sep-2024-484420

v8/07-Sep-2024-3830

vm/07-Sep-2024-135101

webstreams/07-Sep-2024-11997

worker/07-Sep-2024-211177

zlib/07-Sep-2024-214178

README.mdD07-Sep-20243.2 KiB8160

_benchmark_progress.jsD07-Sep-20243.9 KiB12093

_cli.RD07-Sep-2024494 2516

_cli.jsD07-Sep-20243.1 KiB12896

_http-benchmarkers.jsD07-Sep-20247.4 KiB258218

_test-double-benchmarker.jsD07-Sep-20241.1 KiB5546

bar.RD07-Sep-20241.1 KiB3727

common.jsD07-Sep-202413.1 KiB437338

compare.RD07-Sep-20243.9 KiB12187

compare.jsD07-Sep-20243.5 KiB11482

run.jsD07-Sep-20242.5 KiB8772

scatter.RD07-Sep-20242.4 KiB8763

scatter.jsD07-Sep-20241.8 KiB7451

README.md

1# Node.js Core Benchmarks
2
3This folder contains code and data used to measure performance
4of different Node.js implementations and different ways of
5writing JavaScript run by the built-in JavaScript engine.
6
7For a detailed guide on how to write and run benchmarks in this
8directory, see [the guide on benchmarks](../doc/contributing/writing-and-running-benchmarks.md).
9
10## Table of Contents
11
12* [File tree structure](#file-tree-structure)
13* [Common API](#common-api)
14
15## File tree structure
16
17### Directories
18
19Benchmarks testing the performance of a single node submodule are placed into a
20directory with the corresponding name, so that they can be executed by submodule
21or individually.
22Benchmarks that span multiple submodules may either be placed into the `misc`
23directory or into a directory named after the feature they benchmark.
24E.g. benchmarks for various new ECMAScript features and their pre-ES2015
25counterparts are placed in a directory named `es`.
26Fixtures that are not specific to a certain benchmark but can be reused
27throughout the benchmark suite should be placed in the `fixtures` directory.
28
29### Other Top-level files
30
31The top-level files include common dependencies of the benchmarks
32and the tools for launching benchmarks and visualizing their output.
33The actual benchmark scripts should be placed in their corresponding
34directories.
35
36* `_benchmark_progress.js`: implements the progress bar displayed
37  when running `compare.js`
38* `_cli.js`: parses the command line arguments passed to `compare.js`,
39  `run.js` and `scatter.js`
40* `_cli.R`: parses the command line arguments passed to `compare.R`
41* `_http-benchmarkers.js`: selects and runs external tools for benchmarking
42  the `http` subsystem.
43* `common.js`: see [Common API](#common-api).
44* `compare.js`: command line tool for comparing performance between different
45  Node.js binaries.
46* `compare.R`: R script for statistically analyzing the output of
47  `compare.js`
48* `run.js`: command line tool for running individual benchmark suite(s).
49* `scatter.js`: command line tool for comparing the performance
50  between different parameters in benchmark configurations,
51  for example to analyze the time complexity.
52* `scatter.R`: R script for visualizing the output of `scatter.js` with
53  scatter plots.
54
55## Common API
56
57The common.js module is used by benchmarks for consistency across repeated
58tasks. It has a number of helpful functions and properties to help with
59writing benchmarks.
60
61### `createBenchmark(fn, configs[, options])`
62
63See [the guide on writing benchmarks](../doc/contributing/writing-and-running-benchmarks.md#basics-of-a-benchmark).
64
65### `default_http_benchmarker`
66
67The default benchmarker used to run HTTP benchmarks.
68See [the guide on writing HTTP benchmarks](../doc/contributing/writing-and-running-benchmarks.md#creating-an-http-benchmark).
69
70### `PORT`
71
72The default port used to run HTTP benchmarks.
73See [the guide on writing HTTP benchmarks](../doc/contributing/writing-and-running-benchmarks.md#creating-an-http-benchmark).
74
75### `sendResult(data)`
76
77Used in special benchmarks that can't use `createBenchmark` and the object
78it returns to accomplish what they need. This function reports timing
79data to the parent process (usually created by running `compare.js`, `run.js` or
80`scatter.js`).
81