-
Notifications
You must be signed in to change notification settings - Fork 2
/
benchmark-build
executable file
·47 lines (45 loc) · 1.2 KB
/
benchmark-build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env node
const { createProjectMatrix, presets } = require('./factory');
const { processRunner } = require('./runner');
const { printTimingSummary } = require('./stats');
processRunner({
matrix: createProjectMatrix({
baseConfig: presets.baseConfig(),
dimensions: [
{
buildTsc: {
buildMode: 'tsc',
},
buildSucrase: {
buildMode: 'rollup-sucrase',
},
buildTypescript: {
buildMode: 'rollup-typescript',
},
buildEsbuild: {
buildMode: 'rollup-esbuild',
},
},
{
small: {
packages: Array(1).fill(presets.packages.balanced(3)),
},
medium: {
packages: Array(1).fill(presets.packages.balanced(12)),
},
large: {
packages: Array(1).fill(presets.packages.balanced(24)),
},
huge: {
packages: Array(1).fill(presets.packages.balanced(36)),
},
},
],
}),
prepare: async (runner) => {},
benchmark: async (runner, count) => {
const timings = await runner.timeCmd({ cmd: ['yarn', 'build'], count });
console.log('*** BUILD TIMES ***');
printTimingSummary(timings);
},
});