mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
benchmark: add startup benchmark for loading public modules
Adding a new benchmark for testing the performance of loading available public modules. PR-URL: https://github.com/nodejs/node/pull/35816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
2 files changed
+51
-1
No files matched your search
@@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
|
||||
const list = [
|
||||
'async_hooks',
|
||||
'assert',
|
||||
'buffer',
|
||||
'child_process',
|
||||
'console',
|
||||
'constants',
|
||||
'crypto',
|
||||
'cluster',
|
||||
'dgram',
|
||||
'dns',
|
||||
'domain',
|
||||
'events',
|
||||
'fs',
|
||||
'http',
|
||||
'http2',
|
||||
'https',
|
||||
'inspector',
|
||||
'module',
|
||||
'net',
|
||||
'os',
|
||||
'path',
|
||||
'perf_hooks',
|
||||
'process',
|
||||
'punycode',
|
||||
'querystring',
|
||||
'readline',
|
||||
'repl',
|
||||
'stream',
|
||||
'string_decoder',
|
||||
'timers',
|
||||
'tls',
|
||||
'trace_events',
|
||||
'tty',
|
||||
'url',
|
||||
'util',
|
||||
'vm',
|
||||
'zlib',
|
||||
];
|
||||
|
||||
for (let i = 0; i < list.length; ++i) {
|
||||
const item = list[i];
|
||||
require(item);
|
||||
}
|
||||
@@ -7,7 +7,11 @@ let Worker; // Lazy loaded in main
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
dur: [1],
|
||||
script: ['benchmark/fixtures/require-cachable', 'test/fixtures/semicolon'],
|
||||
script: [
|
||||
'benchmark/fixtures/require-builtins',
|
||||
'benchmark/fixtures/require-cachable',
|
||||
'test/fixtures/semicolon',
|
||||
],
|
||||
mode: ['process', 'worker']
|
||||
}, {
|
||||
flags: ['--expose-internals']
|
||||
|
||||
Reference in new issue
Block a user