• Home
Name Date Size #Lines LOC

..--

assert/12-May-2024-455398

async_hooks/12-May-2024-552438

blob/12-May-2024-6657

buffers/12-May-2024-1,3571,127

child_process/12-May-2024-272232

cluster/12-May-2024-7667

crypto/12-May-2024-1,032862

dgram/12-May-2024-281211

diagnostics_channel/12-May-2024-147121

dns/12-May-2024-6859

domain/12-May-2024-3427

error/12-May-2024-3729

es/12-May-2024-709610

esm/12-May-2024-9370

events/12-May-2024-309258

fixtures/12-May-2024-4,2823,327

fs/12-May-2024-831656

http/12-May-2024-820670

http2/12-May-2024-215186

https/12-May-2024-3026

misc/12-May-2024-550450

module/12-May-2024-227183

napi/12-May-2024-1,102889

net/12-May-2024-950732

os/12-May-2024-4836

path/12-May-2024-590517

perf_hooks/12-May-2024-178152

policy/12-May-2024-5240

process/12-May-2024-517437

querystring/12-May-2024-10587

streams/12-May-2024-402321

string_decoder/12-May-2024-10490

timers/12-May-2024-530410

tls/12-May-2024-380332

url/12-May-2024-851736

util/12-May-2024-479414

v8/12-May-2024-3830

vm/12-May-2024-9973

webstreams/12-May-2024-11997

worker/12-May-2024-211177

zlib/12-May-2024-214178

README.mdD12-May-20243.2 KiB8160

_benchmark_progress.jsD12-May-20243.9 KiB12093

_cli.RD12-May-2024494 2516

_cli.jsD12-May-20243.1 KiB12896

_http-benchmarkers.jsD12-May-20247.4 KiB258218

_test-double-benchmarker.jsD12-May-20241.1 KiB5546

bar.RD12-May-20241.1 KiB3727

common.jsD12-May-202413.1 KiB437338

compare.RD12-May-20243.9 KiB12187

compare.jsD12-May-20243.5 KiB11482

run.jsD12-May-20242.5 KiB8772

scatter.RD12-May-20242.4 KiB8763

scatter.jsD12-May-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