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 2c7d7ca

Browse filesBrowse files
AdamMajertargos
authored andcommitted
benchmark: filter non-present deps from start-cli-version
PR-URL: #51746 Refs: #51146 Refs: #50684 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent a6d624c commit 2c7d7ca
Copy full SHA for 2c7d7ca

File tree

Expand file treeCollapse file tree

1 file changed

+8
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-10
lines changed
Open diff view settings
Collapse file

‎benchmark/misc/startup-cli-version.js‎

Copy file name to clipboardExpand all lines: benchmark/misc/startup-cli-version.js
+8-10Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ const path = require('path');
99
// tends to be minimal and fewer operations are done to generate
1010
// these so that the startup cost is still dominated by a more
1111
// indispensible part of the CLI.
12+
// NOTE: not all tools are present in tarball hence need to filter
13+
const availableCli = [
14+
'tools/node_modules/eslint/bin/eslint.js',
15+
'deps/npm/bin/npx-cli.js',
16+
'deps/npm/bin/npm-cli.js',
17+
'deps/corepack/dist/corepack.js',
18+
].filter((cli) => existsSync(path.resolve(__dirname, '../../', cli)));
1219
const bench = common.createBenchmark(main, {
13-
cli: [
14-
'tools/node_modules/eslint/bin/eslint.js',
15-
'deps/npm/bin/npx-cli.js',
16-
'deps/npm/bin/npm-cli.js',
17-
'deps/corepack/dist/corepack.js',
18-
],
20+
cli: availableCli,
1921
count: [30],
2022
});
2123

@@ -47,10 +49,6 @@ function spawnProcess(cli, bench, state) {
4749

4850
function main({ count, cli }) {
4951
cli = path.resolve(__dirname, '../../', cli);
50-
if (!existsSync(cli)) {
51-
return;
52-
}
53-
5452
const warmup = 3;
5553
const state = { count, finished: -warmup };
5654
spawnProcess(cli, bench, state);

0 commit comments

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