Skip to content

Commit d32bbdf

Browse files
committed
chore: simplify benchmark config
1 parent bbcd9b1 commit d32bbdf

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

benchmark.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const parseToolNames = () => {
188188
if (process.env.TOOLS) {
189189
return process.env.TOOLS?.split(',').map((item) => item.toLowerCase());
190190
}
191-
return config.defaultTools;
191+
return config.defaultTools ?? config.supportedTools;
192192
};
193193

194194
const toolNames = parseToolNames();
@@ -432,7 +432,7 @@ async function runDevBenchmark(buildTool, perfResult) {
432432
});
433433

434434
await new Promise((resolve) => setTimeout(resolve, 1000));
435-
const rootFilePath = path.join(srcDir, 'f0.jsx');
435+
const rootFilePath = path.join(srcDir, config.rootFile);
436436
const originalRootFileContent = readFileSync(rootFilePath, 'utf-8');
437437

438438
appendFile(
@@ -448,7 +448,7 @@ async function runDevBenchmark(buildTool, perfResult) {
448448

449449
await new Promise((resolve) => setTimeout(resolve, 1000));
450450

451-
const leafFilePath = path.join(srcDir, 'd0/d0/d0/f0.jsx');
451+
const leafFilePath = path.join(srcDir, config.leafFile);
452452
const originalLeafFileContent = readFileSync(leafFilePath, 'utf-8');
453453
appendFile(
454454
leafFilePath,

cases/react-10k/benchmark-config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const config = {
88
'farm',
99
],
1010
defaultTools: ['rspack', 'rsbuild', 'rolldown-vite', 'vite', 'webpack'],
11+
rootFile: 'f0.jsx',
12+
leafFile: 'd0/d0/d0/f0.jsx',
1113
};

cases/react-1k/benchmark-config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const config = {
88
'farm',
99
],
1010
defaultTools: ['rspack', 'rsbuild', 'rolldown-vite', 'vite', 'webpack'],
11+
rootFile: 'f0.jsx',
12+
leafFile: 'd0/d0/d0/f0.jsx',
1113
};

cases/react-5k/benchmark-config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const config = {
88
'farm',
99
],
1010
defaultTools: ['rspack', 'rsbuild', 'rolldown-vite', 'vite', 'webpack'],
11+
rootFile: 'f0.jsx',
12+
leafFile: 'd0/d0/d0/f0.jsx',
1113
};

cases/rome/benchmark-config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const config = {
22
supportedTools: ['rspack', 'rsbuild', 'rolldown', 'webpack', 'esbuild'],
3-
defaultTools: ['rspack', 'rsbuild', 'rolldown', 'webpack', 'esbuild'],
43
dev: false,
54
};

cases/ui-components/benchmark-config.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,5 @@ export const config = {
99
'esbuild',
1010
'farm',
1111
],
12-
defaultTools: [
13-
'rspack',
14-
'rsbuild',
15-
'vite',
16-
'rolldown-vite',
17-
'rolldown',
18-
'webpack',
19-
'esbuild',
20-
'farm',
21-
],
2212
dev: false,
2313
};

0 commit comments

Comments
 (0)