-
Notifications
You must be signed in to change notification settings - Fork 2
/
benchmark-bundle
executable file
·36 lines (34 loc) · 949 Bytes
/
benchmark-bundle
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
#!/usr/bin/env node
const { createProjectMatrix, presets } = require('./factory');
const { processRunner } = require('./runner');
const { printTimingSummary } = require('./stats');
processRunner({
matrix: createProjectMatrix({
baseConfig: presets.baseConfig({
packages: Array(100).fill(presets.packages.balanced(20)),
buildMode: 'none',
}),
dimensions: [
{
bundleTs: {
bundleMode: 'ts-transpile',
},
bundleSucrase: {
bundleMode: 'sucrase-transpile',
},
bundleEsbuild: {
bundleMode: 'esbuild-transpile',
},
bundleBabel: {
bundleMode: 'babel-transpile',
},
},
],
}),
prepare: async (runner) => {},
benchmark: async (runner, count) => {
const timings = await runner.timeCmd({ cmd: ['yarn', 'bundle'], count });
console.log('*** BUNDLE TIMES ***');
printTimingSummary(timings);
},
});