Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab4375e

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
benchmark: add startup benchmark for ESM entrypoint
PR-URL: #61769 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
1 parent df47720 commit ab4375e
Copy full SHA for ab4375e

3 files changed

+40-4Lines changed: 40 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/fixtures/empty.mjs‎

Copy file name to clipboardExpand all lines: benchmark/fixtures/empty.mjs
Whitespace-only changes.
Collapse file
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'node:async_hooks';
2+
import 'node:assert';
3+
import 'node:buffer';
4+
import 'node:child_process';
5+
import 'node:console';
6+
import 'node:constants';
7+
import 'node:crypto';
8+
import 'node:cluster';
9+
import 'node:dgram';
10+
import 'node:dns';
11+
import 'node:domain';
12+
import 'node:events';
13+
import 'node:fs';
14+
import 'node:http';
15+
import 'node:http2';
16+
import 'node:https';
17+
import 'node:module';
18+
import 'node:net';
19+
import 'node:os';
20+
import 'node:path';
21+
import 'node:perf_hooks';
22+
import 'node:process';
23+
import 'node:querystring';
24+
import 'node:readline';
25+
import 'node:repl';
26+
import 'node:stream';
27+
import 'node:string_decoder';
28+
import 'node:timers';
29+
import 'node:tls';
30+
import 'node:tty';
31+
import 'node:url';
32+
import 'node:util';
33+
import 'node:vm';
34+
import 'node:zlib';
Collapse file

‎benchmark/misc/startup-core.js‎

Copy file name to clipboardExpand all lines: benchmark/misc/startup-core.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ let Worker; // Lazy loaded in main
77

88
const bench = common.createBenchmark(main, {
99
script: [
10-
'benchmark/fixtures/require-builtins',
11-
'test/fixtures/semicolon',
12-
'test/fixtures/snapshot/typescript',
10+
'benchmark/fixtures/empty.mjs',
11+
'benchmark/fixtures/import-builtins.mjs',
12+
'benchmark/fixtures/require-builtins.js',
13+
'test/fixtures/semicolon.js',
14+
'test/fixtures/snapshot/typescript.js',
1315
],
1416
mode: ['process', 'worker'],
1517
n: [30],
@@ -58,7 +60,7 @@ function spawnWorker(script, bench, state) {
5860
}
5961

6062
function main({ n, script, mode }) {
61-
script = path.resolve(__dirname, '../../', `${script}.js`);
63+
script = path.resolve(__dirname, '../../', `${script}`);
6264
const warmup = 3;
6365
const state = { n, finished: -warmup };
6466
if (mode === 'worker') {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.