This commit is contained in:
parent
6502229e81
commit
abbeb2783e
@ -111,12 +111,32 @@ Index: node-v21.4.0/benchmark/misc/startup-cli-version.js
|
||||
===================================================================
|
||||
--- node-v21.4.0.orig/benchmark/misc/startup-cli-version.js
|
||||
+++ node-v21.4.0/benchmark/misc/startup-cli-version.js
|
||||
@@ -10,7 +10,7 @@ const path = require('path');
|
||||
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
const common = require('../common.js');
|
||||
const { spawnSync } = require('child_process');
|
||||
+const { existsSync } = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// This benchmarks the startup of various CLI tools that are already
|
||||
@@ -10,7 +11,8 @@ const path = require('path');
|
||||
// indispensible part of the CLI.
|
||||
const bench = common.createBenchmark(main, {
|
||||
cli: [
|
||||
- 'tools/node_modules/eslint/bin/eslint.js',
|
||||
+ 'deps/npm/bin/npx-cli.js',
|
||||
+ 'deps/npm/bin/npx-cli.js',
|
||||
'deps/npm/bin/npm-cli.js',
|
||||
'deps/corepack/dist/corepack.js',
|
||||
],
|
||||
@@ -45,6 +47,10 @@ function spawnProcess(cli, bench, state)
|
||||
|
||||
function main({ count, cli }) {
|
||||
cli = path.resolve(__dirname, '../../', cli);
|
||||
+ if (!existsSync(cli)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
const warmup = 3;
|
||||
const state = { count, finished: -warmup };
|
||||
spawnProcess(cli, bench, state);
|
||||
|
Loading…
Reference in New Issue
Block a user