diff --git a/packages-private/diagnostics-backend/test/__snapshots__/render-md.md b/packages-private/diagnostics-backend/test/__snapshots__/render-md.md index 692f0209c2..c7fdf641a7 100644 --- a/packages-private/diagnostics-backend/test/__snapshots__/render-md.md +++ b/packages-private/diagnostics-backend/test/__snapshots__/render-md.md @@ -3,9 +3,9 @@ ### Memory: After GC | Metric | @ Base | @ Head | Δ | MAD | | --- | ---: | ---: | ---: | ---: | -| **HeapUsed** | 152 MB
± 1 MB | 168 MB
± 1 MB | $\color{orange}{\text{+16 MB}}$
$\color{orange}{\text{+10.5\\%}}$ | 1.4 MB | -| **PSS** | 202 MB
± 1 MB | 218 MB
± 1 MB | $\color{orange}{\text{+16 MB}}$
$\color{orange}{\text{+7.9\\%}}$ | 1.4 MB | -| **USS** | 184 MB
± 1 MB | 200 MB
± 1 MB | $\color{orange}{\text{+16 MB}}$
$\color{orange}{\text{+8.7\\%}}$ | 1.4 MB | +| **HeapUsed** | 152 MB
± 1 MB | 168 MB
± 1 MB | $\color{orange}{\text{+16~MB}}$
$\color{orange}{\text{+10.5\\%}}$ | 1.4 MB | +| **PSS** | 202 MB
± 1 MB | 218 MB
± 1 MB | $\color{orange}{\text{+16~MB}}$
$\color{orange}{\text{+7.9\\%}}$ | 1.4 MB | +| **USS** | 184 MB
± 1 MB | 200 MB
± 1 MB | $\color{orange}{\text{+16~MB}}$
$\color{orange}{\text{+8.7\\%}}$ | 1.4 MB | Only metrics showing significant changes are displayed. @@ -14,15 +14,15 @@ | Metric | @ Base | @ Head | Δ | MAD | | --- | ---: | ---: | ---: | ---: | -| $\color{gray}{\rule{8pt}{8pt}}$ **Total** | 40 MB
± 200 KB | 44 MB
± 200 KB | $\color{orange}{\text{+3.2 MB}}$
$\color{orange}{\text{+7.9\\%}}$ | 283 KB | +| $\color{gray}{\rule{8pt}{8pt}}$ **Total** | 40 MB
± 200 KB | 44 MB
± 200 KB | $\color{orange}{\text{+3.2 MB}}$
$\color{orange}{\text{+7.9\\%}}$ | 283 KB | | | | | | | -| $\color{orange}{\rule{8pt}{8pt}}$ **Code** | 4.7 MB | 5.1 MB | $\color{orange}{\text{+376 KB}}$ | 33 KB | -| $\color{red}{\rule{8pt}{8pt}}$ **Strings** | 4.4 MB | 4.8 MB | $\color{orange}{\text{+352 KB}}$ | 31 KB | -| $\color{cyan}{\rule{8pt}{8pt}}$ **JS arrays** | 4.1 MB | 4.5 MB | $\color{orange}{\text{+328 KB}}$ | 29 KB | -| $\color{green}{\rule{8pt}{8pt}}$ **Typed arrays** | 3.8 MB | 4.1 MB | $\color{orange}{\text{+304 KB}}$ | 27 KB | -| $\color{yellow}{\rule{8pt}{8pt}}$ **System objects** | 3.5 MB | 3.8 MB | $\color{orange}{\text{+280 KB}}$ | 25 KB | -| $\color{violet}{\rule{8pt}{8pt}}$ **Other JS objs** | 3.2 MB | 3.5 MB | $\color{orange}{\text{+256 KB}}$ | 23 KB | -| $\color{pink}{\rule{8pt}{8pt}}$ **Other non-JS objs** | 2.9 MB | 3.2 MB | $\color{orange}{\text{+232 KB}}$ | 21 KB | +| $\color{orange}{\rule{8pt}{8pt}}$ **Code** | 4.7 MB | 5.1 MB | $\color{orange}{\text{+376 KB}}$ | 33 KB | +| $\color{red}{\rule{8pt}{8pt}}$ **Strings** | 4.4 MB | 4.8 MB | $\color{orange}{\text{+352 KB}}$ | 31 KB | +| $\color{cyan}{\rule{8pt}{8pt}}$ **JS arrays** | 4.1 MB | 4.5 MB | $\color{orange}{\text{+328 KB}}$ | 29 KB | +| $\color{green}{\rule{8pt}{8pt}}$ **Typed arrays** | 3.8 MB | 4.1 MB | $\color{orange}{\text{+304 KB}}$ | 27 KB | +| $\color{yellow}{\rule{8pt}{8pt}}$ **System objects** | 3.5 MB | 3.8 MB | $\color{orange}{\text{+280 KB}}$ | 25 KB | +| $\color{violet}{\rule{8pt}{8pt}}$ **Other JS objs** | 3.2 MB | 3.5 MB | $\color{orange}{\text{+256 KB}}$ | 23 KB | +| $\color{pink}{\rule{8pt}{8pt}}$ **Other non-JS objs** | 2.9 MB | 3.2 MB | $\color{orange}{\text{+232 KB}}$ | 21 KB | Download representative heap snapshot: [base](https://example.invalid/base) / [head](https://example.invalid/head) diff --git a/packages-private/diagnostics-frontend/src/bundle/chunk-report.ts b/packages-private/diagnostics-frontend/src/bundle/chunk-report.ts index 55857305c5..50e2758328 100644 --- a/packages-private/diagnostics-frontend/src/bundle/chunk-report.ts +++ b/packages-private/diagnostics-frontend/src/bundle/chunk-report.ts @@ -131,7 +131,7 @@ export function chunkMarkdownTable( if (rows.length === 0 && total == null && !hasGenerated && !hasOther) return '_No data_'; const lines = [ - '| Chunk | Base | Head | Δ | Δ (%) |', + '| Chunk | Base | Head | Δ | Δ (%) |', // nbspにすること '| --- | ---: | ---: | ---: | ---: |', ]; if (total != null) { @@ -150,7 +150,8 @@ export function chunkMarkdownTable( } } if (hasGenerated) { - lines.push(`| (other generated chunks) | ${formatBytes(generated.baseSize)} | ${formatBytes(generated.headSize)} | ${calcAndFormatDeltaBytes(generated.baseSize, generated.headSize, 1000)} | ${calcAndFormatDeltaPercentInMdTable(generated.baseSize, generated.headSize, 0.1)} |`); + // eslint-disable-next-line no-irregular-whitespace + lines.push(`| (other generated chunks) | ${formatBytes(generated.baseSize)} | ${formatBytes(generated.headSize)} | ${calcAndFormatDeltaBytes(generated.baseSize, generated.headSize, 1000)} | ${calcAndFormatDeltaPercentInMdTable(generated.baseSize, generated.headSize, 0.1)} |`); // nbspにすること } if (hasOther) { lines.push(`| (other) | ${formatBytes(other.baseSize)} | ${formatBytes(other.headSize)} | ${calcAndFormatDeltaBytes(other.baseSize, other.headSize, 1000)} | ${calcAndFormatDeltaPercentInMdTable(other.baseSize, other.headSize, 0.1)} |`); diff --git a/packages-private/diagnostics-frontend/test/__snapshots__/report.md b/packages-private/diagnostics-frontend/test/__snapshots__/report.md index 0288d7f379..84a5a3e90f 100644 --- a/packages-private/diagnostics-frontend/test/__snapshots__/report.md +++ b/packages-private/diagnostics-frontend/test/__snapshots__/report.md @@ -2,11 +2,11 @@ | Metric | @ Base | @ Head | Δ | MAD | | --- | ---: | ---: | ---: | ---: | -| **Encoded network** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\color{orange}{\text{+83 KB}}$
$\color{orange}{\text{+8\\%}}$ | 15 KB | -| **Decoded body** | 3.5 MB
± 34 KB | 3.7 MB
± 37 KB | $\color{orange}{\text{+277 KB}}$
$\color{orange}{\text{+8\\%}}$ | 50 KB | -| **Same-origin encoded** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\color{orange}{\text{+82 KB}}$
$\color{orange}{\text{+8\\%}}$ | 15 KB | -| **Script encoded** | 918 KB
± 9 KB | 991 KB
± 9.7 KB | $\color{orange}{\text{+73 KB}}$
$\color{orange}{\text{+8\\%}}$ | 13 KB | -| **Page-attributed memory** | 92 MB
± 900 KB | 99 MB
± 972 KB | $\color{orange}{\text{+7.3 MB}}$
$\color{orange}{\text{+8\\%}}$ | 1.3 MB | +| **Encoded network** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\color{orange}{\text{+83 KB}}$
$\color{orange}{\text{+8\\%}}$ | 15 KB | +| **Decoded body** | 3.5 MB
± 34 KB | 3.7 MB
± 37 KB | $\color{orange}{\text{+277 KB}}$
$\color{orange}{\text{+8\\%}}$ | 50 KB | +| **Same-origin encoded** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\color{orange}{\text{+82 KB}}$
$\color{orange}{\text{+8\\%}}$ | 15 KB | +| **Script encoded** | 918 KB
± 9 KB | 991 KB
± 9.7 KB | $\color{orange}{\text{+73 KB}}$
$\color{orange}{\text{+8\\%}}$ | 13 KB | +| **Page-attributed memory** | 92 MB
± 900 KB | 99 MB
± 972 KB | $\color{orange}{\text{+7.3 MB}}$
$\color{orange}{\text{+8\\%}}$ | 1.3 MB | Only metrics showing significant changes are displayed. @@ -37,27 +37,27 @@ 10 10 0 -918 KB -991 KB -$\color{orange}{\text{+73 KB}}$ +918 KB +991 KB +$\color{orange}{\text{+73 KB}}$ Stylesheet 2 2 0 -82 KB -88 KB -$\color{orange}{\text{+6.5 KB}}$ +82 KB +88 KB +$\color{orange}{\text{+6.5 KB}}$ Fetch 6 6 0 -41 KB -44 KB -$\color{orange}{\text{+3.3 KB}}$ +41 KB +44 KB +$\color{orange}{\text{+3.3 KB}}$ @@ -69,15 +69,15 @@ | Metric | @ Base | @ Head | Δ | MAD | | --- | ---: | ---: | ---: | ---: | -| $\color{gray}{\rule{8pt}{8pt}}$ **Total** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\text{+82 KB}$
$\text{+8\\%}$ | 15 KB | +| $\color{gray}{\rule{8pt}{8pt}}$ **Total** | 1 MB
± 10 KB | 1.1 MB
± 11 KB | $\text{+82 KB}$
$\text{+8\\%}$ | 15 KB | | | | | | | -| $\color{orange}{\rule{8pt}{8pt}}$ **Code** | 2 MB | 2.2 MB | $\color{orange}{\text{+163 KB}}$ | 29 KB | -| $\color{red}{\rule{8pt}{8pt}}$ **Strings** | 3.1 MB | 3.3 MB | $\color{orange}{\text{+245 KB}}$ | 44 KB | -| $\color{cyan}{\rule{8pt}{8pt}}$ **JS arrays** | 4.1 MB | 4.4 MB | $\color{orange}{\text{+326 KB}}$ | 59 KB | -| $\color{green}{\rule{8pt}{8pt}}$ **Typed arrays** | 5.1 MB | 5.5 MB | $\color{orange}{\text{+408 KB}}$ | 74 KB | -| $\color{yellow}{\rule{8pt}{8pt}}$ **System objects** | 6.1 MB | 6.6 MB | $\color{orange}{\text{+490 KB}}$ | 88 KB | -| $\color{violet}{\rule{8pt}{8pt}}$ **Other JS objs** | 7.1 MB | 7.7 MB | $\color{orange}{\text{+571 KB}}$ | 103 KB | -| $\color{pink}{\rule{8pt}{8pt}}$ **Other non-JS objs** | 8.2 MB | 8.8 MB | $\color{orange}{\text{+653 KB}}$ | 118 KB | +| $\color{orange}{\rule{8pt}{8pt}}$ **Code** | 2 MB | 2.2 MB | $\color{orange}{\text{+163 KB}}$ | 29 KB | +| $\color{red}{\rule{8pt}{8pt}}$ **Strings** | 3.1 MB | 3.3 MB | $\color{orange}{\text{+245 KB}}$ | 44 KB | +| $\color{cyan}{\rule{8pt}{8pt}}$ **JS arrays** | 4.1 MB | 4.4 MB | $\color{orange}{\text{+326 KB}}$ | 59 KB | +| $\color{green}{\rule{8pt}{8pt}}$ **Typed arrays** | 5.1 MB | 5.5 MB | $\color{orange}{\text{+408 KB}}$ | 74 KB | +| $\color{yellow}{\rule{8pt}{8pt}}$ **System objects** | 6.1 MB | 6.6 MB | $\color{orange}{\text{+490 KB}}$ | 88 KB | +| $\color{violet}{\rule{8pt}{8pt}}$ **Other JS objs** | 7.1 MB | 7.7 MB | $\color{orange}{\text{+571 KB}}$ | 103 KB | +| $\color{pink}{\rule{8pt}{8pt}}$ **Other non-JS objs** | 8.2 MB | 8.8 MB | $\color{orange}{\text{+653 KB}}$ | 118 KB | Download representative heap snapshot: [base](https://example.invalid/base) / [head](https://example.invalid/head) @@ -87,25 +87,25 @@ Download representative heap snapshot: [base](https://example.invalid/base) / [h
Chunk size diff (2 updated, 0 added, 0 removed) -| Chunk | Base | Head | Δ | Δ (%) | +| Chunk | Base | Head | Δ | Δ (%) | | --- | ---: | ---: | ---: | ---: | -| (total) | 120 KB | 127 KB | $\color{orange}{\text{+6.3 KB}}$ | $\color{orange}{\text{+5.2\\%}}$ | +| (total) | 120 KB | 127 KB | $\color{orange}{\text{+6.3 KB}}$ | $\color{orange}{\text{+5.2\\%}}$ | | | | | | | -|
`vue` `assets/vue-b2.js`
| 90 KB | 96 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+6.7\\%}}$ | -| (other generated chunks) | 1.2 KB | 1.5 KB | $\text{+300 B}$ | $\color{orange}{\text{+25\\%}}$ | -| (other) | 20 KB | 20 KB | $\text{+3 B}$ | $\text{+0\\%}$ | +|
`vue` `assets/vue-b2.js`
| 90 KB | 96 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+6.7\\%}}$ | +| (other generated chunks) | 1.2 KB | 1.5 KB | $\text{+300 B}$ | $\color{orange}{\text{+25\\%}}$ | +| (other) | 20 KB | 20 KB | $\text{+3 B}$ | $\text{+0\\%}$ |
Startup chunk size (2 updated, 0 added, 0 removed) -| Chunk | Base | Head | Δ | Δ (%) | +| Chunk | Base | Head | Δ | Δ (%) | | --- | ---: | ---: | ---: | ---: | -| (total) | 114 KB | 120 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+5.3\\%}}$ | +| (total) | 114 KB | 120 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+5.3\\%}}$ | | | | | | | -|
`vue` `assets/vue-b2.js`
| 90 KB | 96 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+6.7\\%}}$ | -| (other) | 24 KB | 24 KB | $\text{+3 B}$ | $\text{+0\\%}$ | +|
`vue` `assets/vue-b2.js`
| 90 KB | 96 KB | $\color{orange}{\text{+6 KB}}$ | $\color{orange}{\text{+6.7\\%}}$ | +| (other) | 24 KB | 24 KB | $\text{+3 B}$ | $\text{+0\\%}$ | _Startup chunks are the Vite entry for `src/_boot_.ts` and its static imports._ @@ -138,9 +138,9 @@ _Startup chunks are the Vite entry for `src/_boot_.ts` and its static imports._ 1 2 3 -21 KB -6.3 KB -5.3 KB +21 KB +6.3 KB +5.3 KB Head @@ -149,9 +149,9 @@ _Startup chunks are the Vite entry for `src/_boot_.ts` and its static imports._ 1 3 3 -31 KB -8.4 KB -7 KB +31 KB +8.4 KB +7 KB @@ -161,12 +161,12 @@ _Startup chunks are the Vite entry for `src/_boot_.ts` and its static imports._ 0 $\color{orange}{\text{+1}}$ 0 -$\color{orange}{\text{+9.8 KB}}$ -$\color{orange}{\text{+2.1 KB}}$ -$\color{orange}{\text{+1.8 KB}}$ +$\color{orange}{\text{+9.8 KB}}$ +$\color{orange}{\text{+2.1 KB}}$ +$\color{orange}{\text{+1.8 KB}}$ -Δ (%) +Δ (%) 0% $\color{orange}{\text{+16.7\%}}$ 0% diff --git a/packages-private/diagnostics-frontend/test/browser/__snapshots__/render-html.html b/packages-private/diagnostics-frontend/test/browser/__snapshots__/render-html.html index 3e96d7cca6..4a44b7cafb 100644 --- a/packages-private/diagnostics-frontend/test/browser/__snapshots__/render-html.html +++ b/packages-private/diagnostics-frontend/test/browser/__snapshots__/render-html.html @@ -232,8 +232,8 @@
Round
1
Base count
0
Head count
1
-
Encoded
50 KB
-
Decoded body
120 KB
+
Encoded
50 KB
+
Decoded body
120 KB
MIME
text/javascript
Protocol
h2
Remote
-
@@ -276,8 +276,8 @@
Round
2
Base count
0
Head count
1
-
Encoded
50 KB
-
Decoded body
120 KB
+
Encoded
50 KB
+
Decoded body
120 KB
MIME
text/javascript
Protocol
h2
Remote
-
@@ -320,8 +320,8 @@
Round
3
Base count
0
Head count
1
-
Encoded
50 KB
-
Decoded body
120 KB
+
Encoded
50 KB
+
Decoded body
120 KB
MIME
text/javascript
Protocol
h2
Remote
-
diff --git a/packages-private/diagnostics-shared/src/heap-snapshot/render.ts b/packages-private/diagnostics-shared/src/heap-snapshot/render.ts index 1f8631ff8b..f1f1ea30f5 100644 --- a/packages-private/diagnostics-shared/src/heap-snapshot/render.ts +++ b/packages-private/diagnostics-shared/src/heap-snapshot/render.ts @@ -20,7 +20,8 @@ function categoryValue(report: HeapSnapshotReport, category: HeapSnapshotCategor } function swatch(category: HeapSnapshotCategory) { - return `$\\color{${heapSnapshotCategory[category].color}}{\\rule{8pt}{8pt}}$ **${heapSnapshotCategory[category].label}**`; + // eslint-disable-next-line no-irregular-whitespace + return `$\\color{${heapSnapshotCategory[category].color}}{\\rule{8pt}{8pt}}$ **${heapSnapshotCategory[category].label.replaceAll(' ', ' ')}**`; // nbspにすること } /**