@@ -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 ) ) ) ;
1219const 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
4850function 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