Skip to content

Commit ec759c0

Browse files
committed
chore: merge markdown table
1 parent 914b75c commit ec759c0

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CASE=react-1k pnpm benchmark
4444

4545
#### Bundle sizes
4646

47-
| Name | Total size | Gzipped size |
47+
| Name |
4848
| ---------------------------- | ---------- | ------------ |
4949
| Rspack CLI 1.4.10 | 838.9kB🥉 | 218.5kB |
5050
| Rspack CLI (Lazy) 1.4.10 | 838.9kB | 218.5kB |

benchmark.mjs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ async function runDevBenchmark(buildTool, perfResult) {
365365
const loadTime = Date.now() - start;
366366
logger.success(
367367
color.dim(buildTool.name) +
368-
' Dev cold start in ' +
368+
' dev cold start in ' +
369369
color.green(time + loadTime + 'ms'),
370370
);
371371

@@ -410,7 +410,7 @@ async function runDevBenchmark(buildTool, perfResult) {
410410
const hmrTime = clientDateNow - hmrRootStart;
411411
logger.success(
412412
color.dim(buildTool.name) +
413-
' root HMR in ' +
413+
' HMR (root module) in ' +
414414
color.green(hmrTime + 'ms'),
415415
);
416416

@@ -420,7 +420,7 @@ async function runDevBenchmark(buildTool, perfResult) {
420420
const hmrTime = Date.now() - hmrLeafStart;
421421
logger.success(
422422
color.dim(buildTool.name) +
423-
' leaf HMR in ' +
423+
' HMR (leaf module) in ' +
424424
color.green(hmrTime + 'ms'),
425425
);
426426
perfResult[buildTool.name].leafHmr = hmrTime;
@@ -480,7 +480,7 @@ async function runBuildBenchmark(buildTool, perfResult) {
480480
sizeResults[buildTool.name] = sizes;
481481

482482
logger.success(
483-
color.dim(buildTool.name) + ' built in ' + color.green(buildTime + ' ms'),
483+
color.dim(buildTool.name) + ' built in ' + color.green(buildTime + 'ms'),
484484
);
485485
logger.success(
486486
color.dim(buildTool.name) + ' total size: ' + color.green(sizes.totalSize),
@@ -632,7 +632,16 @@ let markdownLogs = '';
632632
// Use actual tool names from buildTools (with version numbers)
633633
const actualToolNames = buildTools.map(({ name }) => name);
634634

635-
markdownLogs += '#### Build performance\n\n';
635+
const totalSizeRanked = addSizeRankingEmojis(
636+
actualToolNames,
637+
sizeResults,
638+
'totalSize',
639+
);
640+
const totalGzipSizeRanked = addSizeRankingEmojis(
641+
actualToolNames,
642+
sizeResults,
643+
'totalGzipSize',
644+
);
636645

637646
if (runDev) {
638647
// Add ranking emojis for each metric
@@ -649,12 +658,21 @@ if (runDev) {
649658
);
650659

651660
markdownLogs += markdownTable([
652-
['Name', 'Dev cold start', 'HMR', 'Prod build'],
661+
[
662+
'Name',
663+
'Dev cold start',
664+
'HMR',
665+
'Prod build',
666+
'Total size',
667+
'Gzipped size',
668+
],
653669
...actualToolNames.map((name) => [
654670
name,
655671
devColdStartRanked[name],
656672
hmrRanked[name],
657673
prodBuildRanked[name],
674+
totalSizeRanked[name],
675+
totalGzipSizeRanked[name],
658676
]),
659677
]);
660678
} else {
@@ -666,34 +684,16 @@ if (runDev) {
666684
);
667685

668686
markdownLogs += markdownTable([
669-
['Name', 'Prod build'],
670-
...actualToolNames.map((name) => [name, prodBuildRanked[name]]),
687+
['Name', 'Prod build', 'Total size', 'Gzipped size'],
688+
...actualToolNames.map((name) => [
689+
name,
690+
prodBuildRanked[name],
691+
totalSizeRanked[name],
692+
totalGzipSizeRanked[name],
693+
]),
671694
]);
672695
}
673696

674-
markdownLogs += '\n\n#### Bundle sizes\n\n';
675-
676-
// Add ranking emojis for bundle sizes
677-
const totalSizeRanked = addSizeRankingEmojis(
678-
actualToolNames,
679-
sizeResults,
680-
'totalSize',
681-
);
682-
const totalGzipSizeRanked = addSizeRankingEmojis(
683-
actualToolNames,
684-
sizeResults,
685-
'totalGzipSize',
686-
);
687-
688-
markdownLogs += markdownTable([
689-
['Name', 'Total size', 'Gzipped size'],
690-
...actualToolNames.map((name) => [
691-
name,
692-
totalSizeRanked[name],
693-
totalGzipSizeRanked[name],
694-
]),
695-
]);
696-
697-
console.log(markdownLogs);
697+
console.log(markdownLogs + '\n');
698698

699699
process.exit(0);

0 commit comments

Comments
 (0)