@ogygia/devtools 0.0.0-stage → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +25 -2
- package/dist/client.d.ts +3 -0
- package/dist/client.js +24 -0
- package/dist/devtools/BoundaryOverlay.svelte +396 -0
- package/dist/devtools/BoundaryOverlay.svelte.d.ts +19 -0
- package/dist/devtools/Devtools.svelte +663 -0
- package/dist/devtools/Devtools.svelte.d.ts +15 -0
- package/dist/devtools/HubTab.svelte +206 -0
- package/dist/devtools/HubTab.svelte.d.ts +11 -0
- package/dist/devtools/HydrationTab.svelte +237 -0
- package/dist/devtools/HydrationTab.svelte.d.ts +13 -0
- package/dist/devtools/IslandDetail.svelte +615 -0
- package/dist/devtools/IslandDetail.svelte.d.ts +15 -0
- package/dist/devtools/LedgerTab.svelte +287 -0
- package/dist/devtools/LedgerTab.svelte.d.ts +11 -0
- package/dist/devtools/LensTab.svelte +290 -0
- package/dist/devtools/LensTab.svelte.d.ts +19 -0
- package/dist/devtools/NavTab.svelte +229 -0
- package/dist/devtools/NavTab.svelte.d.ts +11 -0
- package/dist/devtools/PageTab.svelte +1122 -0
- package/dist/devtools/PageTab.svelte.d.ts +15 -0
- package/dist/devtools/ProfilerTab.svelte +755 -0
- package/dist/devtools/ProfilerTab.svelte.d.ts +15 -0
- package/dist/devtools/PropsTree.svelte +155 -0
- package/dist/devtools/PropsTree.svelte.d.ts +15 -0
- package/dist/devtools/SessionTab.svelte +796 -0
- package/dist/devtools/SessionTab.svelte.d.ts +11 -0
- package/dist/devtools/TimelineTab.svelte +267 -0
- package/dist/devtools/TimelineTab.svelte.d.ts +11 -0
- package/dist/devtools/WireTab.svelte +149 -0
- package/dist/devtools/WireTab.svelte.d.ts +11 -0
- package/dist/devtools/bytes.d.ts +70 -0
- package/dist/devtools/bytes.js +82 -0
- package/dist/devtools/cache-headers.d.ts +20 -0
- package/dist/devtools/cache-headers.js +81 -0
- package/dist/devtools/highlight.d.ts +7 -0
- package/dist/devtools/highlight.js +83 -0
- package/dist/devtools/hydration.d.ts +48 -0
- package/dist/devtools/hydration.js +93 -0
- package/dist/devtools/index.d.ts +3 -0
- package/dist/devtools/index.js +3 -0
- package/dist/devtools/ledger-dom.d.ts +7 -0
- package/dist/devtools/ledger-dom.js +151 -0
- package/dist/devtools/leftovers.d.ts +77 -0
- package/dist/devtools/leftovers.js +319 -0
- package/dist/devtools/names.d.ts +1 -0
- package/dist/devtools/names.js +34 -0
- package/dist/devtools/page.d.ts +96 -0
- package/dist/devtools/page.js +957 -0
- package/dist/devtools/profile-anchors.d.ts +22 -0
- package/dist/devtools/profile-anchors.js +135 -0
- package/dist/devtools/profile-store.d.ts +175 -0
- package/dist/devtools/profile-store.js +239 -0
- package/dist/devtools/regions.d.ts +77 -0
- package/dist/devtools/regions.js +132 -0
- package/dist/devtools/session.d.ts +31 -0
- package/dist/devtools/session.js +455 -0
- package/dist/devtools/since-load.d.ts +50 -0
- package/dist/devtools/since-load.js +89 -0
- package/dist/devtools/source-lines.d.ts +24 -0
- package/dist/devtools/source-lines.js +106 -0
- package/dist/devtools/styles.d.ts +52 -0
- package/dist/devtools/styles.js +248 -0
- package/dist/devtools/testing-engine.d.ts +83 -0
- package/dist/devtools/testing-engine.js +220 -0
- package/dist/devtools/ui-app.d.ts +5 -0
- package/dist/devtools/ui-app.js +69 -0
- package/dist/devtools/ui.d.ts +50 -0
- package/dist/devtools/ui.js +175 -0
- package/dist/profiler/alloc.d.ts +75 -0
- package/dist/profiler/alloc.js +76 -0
- package/dist/profiler/analyze.d.ts +437 -0
- package/dist/profiler/analyze.js +1941 -0
- package/dist/profiler/app-path.d.ts +7 -0
- package/dist/profiler/app-path.js +26 -0
- package/dist/profiler/async-io.d.ts +58 -0
- package/dist/profiler/async-io.js +187 -0
- package/dist/profiler/beacon-standalone.d.ts +4 -0
- package/dist/profiler/beacon-standalone.js +409 -0
- package/dist/profiler/browser-findings.d.ts +25 -0
- package/dist/profiler/browser-findings.js +260 -0
- package/dist/profiler/byte-strip.d.ts +58 -0
- package/dist/profiler/byte-strip.js +228 -0
- package/dist/profiler/client-files.d.ts +16 -0
- package/dist/profiler/client-files.js +60 -0
- package/dist/profiler/client-windows.d.ts +49 -0
- package/dist/profiler/client-windows.js +95 -0
- package/dist/profiler/client.d.ts +40 -0
- package/dist/profiler/client.js +82 -0
- package/dist/profiler/compare.d.ts +308 -0
- package/dist/profiler/compare.js +733 -0
- package/dist/profiler/compress.d.ts +10 -0
- package/dist/profiler/compress.js +36 -0
- package/dist/profiler/contention.d.ts +60 -0
- package/dist/profiler/contention.js +86 -0
- package/dist/profiler/crypto.d.ts +19 -0
- package/dist/profiler/crypto.js +101 -0
- package/dist/profiler/doc-diff.d.ts +47 -0
- package/dist/profiler/doc-diff.js +214 -0
- package/dist/profiler/dom-diff.d.ts +43 -0
- package/dist/profiler/dom-diff.js +121 -0
- package/dist/profiler/drill.d.ts +89 -0
- package/dist/profiler/drill.js +553 -0
- package/dist/profiler/embedded-maps.d.ts +37 -0
- package/dist/profiler/embedded-maps.js +135 -0
- package/dist/profiler/env.d.ts +6 -0
- package/dist/profiler/env.js +10 -0
- package/dist/profiler/forecast.d.ts +76 -0
- package/dist/profiler/forecast.js +225 -0
- package/dist/profiler/frames.d.ts +11 -0
- package/dist/profiler/frames.js +42 -0
- package/dist/profiler/gc.d.ts +144 -0
- package/dist/profiler/gc.js +271 -0
- package/dist/profiler/hole-slots.d.ts +31 -0
- package/dist/profiler/hole-slots.js +90 -0
- package/dist/profiler/index.d.ts +288 -0
- package/dist/profiler/index.js +4921 -0
- package/dist/profiler/insights.d.ts +96 -0
- package/dist/profiler/insights.js +239 -0
- package/dist/profiler/ledger.d.ts +121 -0
- package/dist/profiler/ledger.js +440 -0
- package/dist/profiler/lineage.d.ts +81 -0
- package/dist/profiler/lineage.js +359 -0
- package/dist/profiler/module-map.d.ts +12 -0
- package/dist/profiler/module-map.js +94 -0
- package/dist/profiler/net.d.ts +169 -0
- package/dist/profiler/net.js +586 -0
- package/dist/profiler/on-demand.d.ts +11 -0
- package/dist/profiler/on-demand.js +15 -0
- package/dist/profiler/own-requests.d.ts +9 -0
- package/dist/profiler/own-requests.js +17 -0
- package/dist/profiler/patterns.d.ts +476 -0
- package/dist/profiler/patterns.js +2203 -0
- package/dist/profiler/profiler-router.d.ts +245 -0
- package/dist/profiler/profiler-router.js +113 -0
- package/dist/profiler/refresh-stub.d.ts +2 -0
- package/dist/profiler/refresh-stub.js +37 -0
- package/dist/profiler/report.d.ts +1404 -0
- package/dist/profiler/report.js +2638 -0
- package/dist/profiler/river.d.ts +65 -0
- package/dist/profiler/river.js +298 -0
- package/dist/profiler/route-files.d.ts +22 -0
- package/dist/profiler/route-files.js +55 -0
- package/dist/profiler/route-imports.d.ts +14 -0
- package/dist/profiler/route-imports.js +83 -0
- package/dist/profiler/saving.d.ts +22 -0
- package/dist/profiler/saving.js +42 -0
- package/dist/profiler/score.d.ts +109 -0
- package/dist/profiler/score.js +261 -0
- package/dist/profiler/session-cookie.d.ts +28 -0
- package/dist/profiler/session-cookie.js +45 -0
- package/dist/profiler/sink.d.ts +81 -0
- package/dist/profiler/sink.js +124 -0
- package/dist/profiler/site-fixes.d.ts +25 -0
- package/dist/profiler/site-fixes.js +62 -0
- package/dist/profiler/source-scan.d.ts +210 -0
- package/dist/profiler/source-scan.js +1724 -0
- package/dist/profiler/span.d.ts +90 -0
- package/dist/profiler/span.js +109 -0
- package/dist/profiler/stacks.d.ts +43 -0
- package/dist/profiler/stacks.js +107 -0
- package/dist/profiler/standalone.d.ts +27 -0
- package/dist/profiler/standalone.js +98 -0
- package/dist/profiler/steps.d.ts +39 -0
- package/dist/profiler/steps.js +74 -0
- package/dist/profiler/storage/index.d.ts +87 -0
- package/dist/profiler/storage/index.js +76 -0
- package/dist/profiler/storage/postgres.d.ts +12 -0
- package/dist/profiler/storage/postgres.js +94 -0
- package/dist/profiler/storage/redis.d.ts +19 -0
- package/dist/profiler/storage/redis.js +148 -0
- package/dist/profiler/storage/sqlite.d.ts +2 -0
- package/dist/profiler/storage/sqlite.js +85 -0
- package/dist/profiler/storage/visits.d.ts +4 -0
- package/dist/profiler/storage/visits.js +6 -0
- package/dist/profiler/stream-tail.d.ts +26 -0
- package/dist/profiler/stream-tail.js +74 -0
- package/dist/profiler/timeline.d.ts +279 -0
- package/dist/profiler/timeline.js +690 -0
- package/dist/profiler/ui/AllocStrip.svelte +146 -0
- package/dist/profiler/ui/AllocStrip.svelte.d.ts +17 -0
- package/dist/profiler/ui/Awaits.svelte +363 -0
- package/dist/profiler/ui/Awaits.svelte.d.ts +16 -0
- package/dist/profiler/ui/ByteStrip.svelte +182 -0
- package/dist/profiler/ui/ByteStrip.svelte.d.ts +18 -0
- package/dist/profiler/ui/Compare.svelte +24 -0
- package/dist/profiler/ui/Compare.svelte.d.ts +16 -0
- package/dist/profiler/ui/CompareBody.svelte +429 -0
- package/dist/profiler/ui/CompareBody.svelte.d.ts +8 -0
- package/dist/profiler/ui/ComponentsTable.svelte +265 -0
- package/dist/profiler/ui/ComponentsTable.svelte.d.ts +20 -0
- package/dist/profiler/ui/Dashboard.svelte +492 -0
- package/dist/profiler/ui/Dashboard.svelte.d.ts +31 -0
- package/dist/profiler/ui/DataRiver.svelte +206 -0
- package/dist/profiler/ui/DataRiver.svelte.d.ts +13 -0
- package/dist/profiler/ui/DomTravel.svelte +207 -0
- package/dist/profiler/ui/DomTravel.svelte.d.ts +9 -0
- package/dist/profiler/ui/DownloadHtml.svelte +52 -0
- package/dist/profiler/ui/DownloadHtml.svelte.d.ts +10 -0
- package/dist/profiler/ui/Drill.svelte +276 -0
- package/dist/profiler/ui/Drill.svelte.d.ts +12 -0
- package/dist/profiler/ui/ExportButton.svelte +59 -0
- package/dist/profiler/ui/ExportButton.svelte.d.ts +8 -0
- package/dist/profiler/ui/Flame.svelte +222 -0
- package/dist/profiler/ui/Flame.svelte.d.ts +12 -0
- package/dist/profiler/ui/FrameDetails.svelte +308 -0
- package/dist/profiler/ui/FrameDetails.svelte.d.ts +16 -0
- package/dist/profiler/ui/FunctionsTable.svelte +156 -0
- package/dist/profiler/ui/FunctionsTable.svelte.d.ts +17 -0
- package/dist/profiler/ui/IslandHeatmap.svelte +151 -0
- package/dist/profiler/ui/IslandHeatmap.svelte.d.ts +16 -0
- package/dist/profiler/ui/IslandsTable.svelte +448 -0
- package/dist/profiler/ui/IslandsTable.svelte.d.ts +16 -0
- package/dist/profiler/ui/KeepLocal.svelte +46 -0
- package/dist/profiler/ui/KeepLocal.svelte.d.ts +8 -0
- package/dist/profiler/ui/Ledger.svelte +196 -0
- package/dist/profiler/ui/Ledger.svelte.d.ts +18 -0
- package/dist/profiler/ui/LocalCompare.svelte +48 -0
- package/dist/profiler/ui/LocalCompare.svelte.d.ts +8 -0
- package/dist/profiler/ui/LocalReports.svelte +68 -0
- package/dist/profiler/ui/LocalReports.svelte.d.ts +7 -0
- package/dist/profiler/ui/Login.svelte +13 -0
- package/dist/profiler/ui/Login.svelte.d.ts +12 -0
- package/dist/profiler/ui/LoginForm.svelte +42 -0
- package/dist/profiler/ui/LoginForm.svelte.d.ts +7 -0
- package/dist/profiler/ui/Message.svelte +10 -0
- package/dist/profiler/ui/Message.svelte.d.ts +12 -0
- package/dist/profiler/ui/OnThisPage.svelte +137 -0
- package/dist/profiler/ui/OnThisPage.svelte.d.ts +3 -0
- package/dist/profiler/ui/OneClock.svelte +297 -0
- package/dist/profiler/ui/OneClock.svelte.d.ts +27 -0
- package/dist/profiler/ui/Panel.svelte +10 -0
- package/dist/profiler/ui/Panel.svelte.d.ts +16 -0
- package/dist/profiler/ui/Paths.svelte +269 -0
- package/dist/profiler/ui/Paths.svelte.d.ts +15 -0
- package/dist/profiler/ui/Patterns.svelte +364 -0
- package/dist/profiler/ui/Patterns.svelte.d.ts +15 -0
- package/dist/profiler/ui/PermalinkGate.svelte +143 -0
- package/dist/profiler/ui/PermalinkGate.svelte.d.ts +10 -0
- package/dist/profiler/ui/RenderSteps.svelte +218 -0
- package/dist/profiler/ui/RenderSteps.svelte.d.ts +13 -0
- package/dist/profiler/ui/Report.svelte +28 -0
- package/dist/profiler/ui/Report.svelte.d.ts +20 -0
- package/dist/profiler/ui/ReportBody.svelte +2592 -0
- package/dist/profiler/ui/ReportBody.svelte.d.ts +21 -0
- package/dist/profiler/ui/Run.svelte +17 -0
- package/dist/profiler/ui/Run.svelte.d.ts +14 -0
- package/dist/profiler/ui/RunView.svelte +146 -0
- package/dist/profiler/ui/RunView.svelte.d.ts +10 -0
- package/dist/profiler/ui/ScoreCard.svelte +197 -0
- package/dist/profiler/ui/ScoreCard.svelte.d.ts +7 -0
- package/dist/profiler/ui/Scrub.svelte +293 -0
- package/dist/profiler/ui/Scrub.svelte.d.ts +18 -0
- package/dist/profiler/ui/SeedExplainer.svelte +193 -0
- package/dist/profiler/ui/SeedExplainer.svelte.d.ts +16 -0
- package/dist/profiler/ui/ShareLink.svelte +148 -0
- package/dist/profiler/ui/ShareLink.svelte.d.ts +8 -0
- package/dist/profiler/ui/Shell.svelte +50 -0
- package/dist/profiler/ui/Shell.svelte.d.ts +27 -0
- package/dist/profiler/ui/Sidebar.svelte +312 -0
- package/dist/profiler/ui/Sidebar.svelte.d.ts +7 -0
- package/dist/profiler/ui/Site.svelte +20 -0
- package/dist/profiler/ui/Site.svelte.d.ts +23 -0
- package/dist/profiler/ui/SiteView.svelte +385 -0
- package/dist/profiler/ui/SiteView.svelte.d.ts +27 -0
- package/dist/profiler/ui/ThemeSwitch.svelte +78 -0
- package/dist/profiler/ui/ThemeSwitch.svelte.d.ts +3 -0
- package/dist/profiler/ui/Timeline.svelte +672 -0
- package/dist/profiler/ui/Timeline.svelte.d.ts +22 -0
- package/dist/profiler/ui/Treemap.svelte +278 -0
- package/dist/profiler/ui/Treemap.svelte.d.ts +20 -0
- package/dist/profiler/ui/Upload.svelte +19 -0
- package/dist/profiler/ui/Upload.svelte.d.ts +10 -0
- package/dist/profiler/ui/UploadForm.svelte +59 -0
- package/dist/profiler/ui/UploadForm.svelte.d.ts +6 -0
- package/dist/profiler/ui/WaitingTable.svelte +55 -0
- package/dist/profiler/ui/WaitingTable.svelte.d.ts +14 -0
- package/dist/profiler/ui/Waterfall.svelte +371 -0
- package/dist/profiler/ui/Waterfall.svelte.d.ts +7 -0
- package/dist/profiler/ui/WhatIf.svelte +87 -0
- package/dist/profiler/ui/WhatIf.svelte.d.ts +18 -0
- package/dist/profiler/ui/fake-progress.svelte.d.ts +15 -0
- package/dist/profiler/ui/fake-progress.svelte.js +38 -0
- package/dist/profiler/ui/format.d.ts +20 -0
- package/dist/profiler/ui/format.js +71 -0
- package/dist/profiler/ui/permalink.d.ts +9 -0
- package/dist/profiler/ui/permalink.js +108 -0
- package/dist/profiler/ui/press.d.ts +5 -0
- package/dist/profiler/ui/press.js +19 -0
- package/dist/profiler/ui/profiler.css +650 -0
- package/dist/profiler/ui/report-data.d.ts +189 -0
- package/dist/profiler/ui/report-data.js +393 -0
- package/dist/profiler/ui/report-request.d.ts +6 -0
- package/dist/profiler/ui/report-request.js +50 -0
- package/dist/profiler/ui/row-anchor.svelte.d.ts +12 -0
- package/dist/profiler/ui/row-anchor.svelte.js +44 -0
- package/dist/profiler/ui/sort.svelte.d.ts +14 -0
- package/dist/profiler/ui/sort.svelte.js +37 -0
- package/dist/profiler/ui/store.d.ts +45 -0
- package/dist/profiler/ui/store.js +92 -0
- package/dist/profiler/visit.d.ts +389 -0
- package/dist/profiler/visit.js +1002 -0
- package/dist/report.d.ts +5 -0
- package/dist/report.js +4 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.js +38 -0
- package/dist/vite.d.ts +12 -0
- package/dist/vite.js +78 -0
- package/package.json +103 -3
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<script>import { fmt_ms, fmt_dur, fmt_pct, fmt_bytes, CATEGORY_COLOR } from "./format.js";
|
|
2
|
+
import { sortable } from "./sort.svelte.js";
|
|
3
|
+
import { pressable } from "./press.js";
|
|
4
|
+
import FrameDetails from "./FrameDetails.svelte";
|
|
5
|
+
import { row_id, follow_hash } from "./row-anchor.svelte.js";
|
|
6
|
+
let { rows, busy, hasAlloc, maxTotal, base = "", dev = false } = $props();
|
|
7
|
+
let query = $state("");
|
|
8
|
+
const filtered = $derived.by(() => {
|
|
9
|
+
const q = query.trim().toLowerCase();
|
|
10
|
+
if (!q) return rows;
|
|
11
|
+
return rows.filter((r) => r.name.toLowerCase().includes(q) || r.url.toLowerCase().includes(q) || (r.path ?? "").toLowerCase().includes(q));
|
|
12
|
+
});
|
|
13
|
+
const s = sortable(() => filtered, "self_ms");
|
|
14
|
+
let open = $state(null);
|
|
15
|
+
const hasSplit = $derived(rows.some((r) => (r.markup_ms ?? 0) + (r.logic_ms ?? 0) > 0));
|
|
16
|
+
const hasParent = $derived(rows.some((r) => !!r.parent));
|
|
17
|
+
// page mode: the spread across runs (min / median / max), a cold first run marked
|
|
18
|
+
const hasRuns = $derived(rows.some((r) => (r.runs_ms?.length ?? 0) > 1));
|
|
19
|
+
const cols = $derived(7 + (hasAlloc ? 1 : 0) + (hasSplit ? 1 : 0) + (hasParent ? 1 : 0) + (hasRuns ? 1 : 0));
|
|
20
|
+
const own = (r) => (r.markup_ms ?? 0) + (r.logic_ms ?? 0);
|
|
21
|
+
const spread = (r) => {
|
|
22
|
+
const xs = r.runs_ms ?? [];
|
|
23
|
+
if (xs.length < 2) return null;
|
|
24
|
+
const s = [...xs].sort((a, b) => a - b);
|
|
25
|
+
const rest = xs.slice(1);
|
|
26
|
+
const rest_med = [...rest].sort((a, b) => a - b)[Math.floor(rest.length / 2)];
|
|
27
|
+
return {
|
|
28
|
+
min: s[0],
|
|
29
|
+
med: s[Math.floor(s.length / 2)],
|
|
30
|
+
max: s[s.length - 1],
|
|
31
|
+
cold: xs[0] >= 5 && xs[0] >= rest_med * 2.5 && xs[0] === s[s.length - 1],
|
|
32
|
+
flaky: s[s.length - 1] >= s[Math.floor(s.length / 2)] * 3 && s[s.length - 1] - s[Math.floor(s.length / 2)] >= 10
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
// a finding's `#comp=<name>` link opens + scrolls to its row
|
|
36
|
+
$effect(() => follow_hash("comp", () => rows.map((r) => r.name), (k) => {
|
|
37
|
+
query = "";
|
|
38
|
+
open = k;
|
|
39
|
+
}));
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div class="tools">
|
|
43
|
+
<input
|
|
44
|
+
type="search"
|
|
45
|
+
placeholder="filter components…"
|
|
46
|
+
bind:value={query}
|
|
47
|
+
aria-label="filter components"
|
|
48
|
+
/>
|
|
49
|
+
<span class="hint"
|
|
50
|
+
>{filtered.length} of {rows.length} · click a row for its location and call stacks</span
|
|
51
|
+
>
|
|
52
|
+
</div>
|
|
53
|
+
<table>
|
|
54
|
+
<thead>
|
|
55
|
+
<tr>
|
|
56
|
+
<th>component</th>
|
|
57
|
+
<th>file</th>
|
|
58
|
+
<th>self / total</th>
|
|
59
|
+
<th
|
|
60
|
+
class="num sort"
|
|
61
|
+
class:active={s.key === 'self_ms'}
|
|
62
|
+
onclick={() => s.click('self_ms')}
|
|
63
|
+
{@attach pressable}
|
|
64
|
+
aria-sort={s.aria('self_ms')}>self ms<span class="arr">{s.arrow('self_ms')}</span></th
|
|
65
|
+
>
|
|
66
|
+
<th
|
|
67
|
+
class="num sort"
|
|
68
|
+
class:active={s.key === 'total_ms'}
|
|
69
|
+
onclick={() => s.click('total_ms')}
|
|
70
|
+
{@attach pressable}
|
|
71
|
+
aria-sort={s.aria('total_ms')}>total ms<span class="arr">{s.arrow('total_ms')}</span></th
|
|
72
|
+
>
|
|
73
|
+
<th
|
|
74
|
+
class="num sort"
|
|
75
|
+
class:active={s.key === 'per'}
|
|
76
|
+
title="one render of it: its time per page render ÷ how many times it rendered in one"
|
|
77
|
+
onclick={() => s.click('per')}
|
|
78
|
+
{@attach pressable}
|
|
79
|
+
aria-sort={s.aria('per')}>per call<span class="arr">{s.arrow('per')}</span></th
|
|
80
|
+
>
|
|
81
|
+
<th class="num">% of busy</th>
|
|
82
|
+
{#if hasSplit}
|
|
83
|
+
<th
|
|
84
|
+
class="sort"
|
|
85
|
+
class:active={s.key === 'markup_ms'}
|
|
86
|
+
title="its own time split: Svelte writing the template (markup) vs its script and what it calls (logic); nested components in neither"
|
|
87
|
+
onclick={() => s.click('markup_ms')}
|
|
88
|
+
{@attach pressable}
|
|
89
|
+
aria-sort={s.aria('markup_ms')}
|
|
90
|
+
>markup / logic<span class="arr">{s.arrow('markup_ms')}</span></th
|
|
91
|
+
>
|
|
92
|
+
{/if}
|
|
93
|
+
{#if hasParent}<th
|
|
94
|
+
title="the component that rendered most of it — the {'{#each}'} owner of a row">under</th
|
|
95
|
+
>{/if}
|
|
96
|
+
{#if hasRuns}<th
|
|
97
|
+
title="its time in each render, min · median · max — a cold first run or a flaky one is marked"
|
|
98
|
+
>per run</th
|
|
99
|
+
>{/if}
|
|
100
|
+
{#if hasAlloc}
|
|
101
|
+
<th
|
|
102
|
+
class="num sort"
|
|
103
|
+
class:active={s.key === 'alloc'}
|
|
104
|
+
onclick={() => s.click('alloc')}
|
|
105
|
+
{@attach pressable}
|
|
106
|
+
aria-sort={s.aria('alloc')}>alloc<span class="arr">{s.arrow('alloc')}</span></th
|
|
107
|
+
>
|
|
108
|
+
{/if}
|
|
109
|
+
</tr>
|
|
110
|
+
</thead>
|
|
111
|
+
<tbody>
|
|
112
|
+
{#each s.sorted as f (f.name)}
|
|
113
|
+
<tr
|
|
114
|
+
class="row"
|
|
115
|
+
id={row_id('comp', f.name)}
|
|
116
|
+
class:open={open === f.name}
|
|
117
|
+
onclick={() => (open = open === f.name ? null : f.name)}
|
|
118
|
+
{@attach pressable}
|
|
119
|
+
>
|
|
120
|
+
<td class="fn">
|
|
121
|
+
<span class="caret">{open === f.name ? '▾' : '▸'}</span>
|
|
122
|
+
<b>{f.name}</b>
|
|
123
|
+
{#if f.count > 1}
|
|
124
|
+
<span class="hint" title="{f.count} renders in one page render, {fmt_ms(f.per)} ms each"
|
|
125
|
+
>×{f.count}</span
|
|
126
|
+
>
|
|
127
|
+
{/if}
|
|
128
|
+
</td>
|
|
129
|
+
<td class="file" title={f.path || ''}>
|
|
130
|
+
{#if f.url}{f.url}{#if f.line > 0}:{f.line}{/if}{:else}<span class="hint">native</span
|
|
131
|
+
>{/if}
|
|
132
|
+
</td>
|
|
133
|
+
<td class="split">
|
|
134
|
+
<div
|
|
135
|
+
class="split-bar"
|
|
136
|
+
title="self {fmt_ms(f.self_ms)} ms of total {fmt_ms(f.total_ms)} ms"
|
|
137
|
+
>
|
|
138
|
+
<div class="tot" style="width:{((f.total_ms / maxTotal) * 100).toFixed(1)}%"></div>
|
|
139
|
+
<div
|
|
140
|
+
class="slf"
|
|
141
|
+
style="width:{((f.self_ms / maxTotal) * 100).toFixed(1)}%;background:{CATEGORY_COLOR[
|
|
142
|
+
f.category
|
|
143
|
+
]}"
|
|
144
|
+
></div>
|
|
145
|
+
</div>
|
|
146
|
+
</td>
|
|
147
|
+
<td class="num"><b>{fmt_ms(f.self_ms)}</b></td>
|
|
148
|
+
<td class="num">{fmt_ms(f.total_ms)}</td>
|
|
149
|
+
<td class="num">{f.count > 0 ? fmt_dur(f.per) : '—'}</td>
|
|
150
|
+
<td class="num">{fmt_pct(f.total_ms, busy)}</td>
|
|
151
|
+
{#if hasSplit}
|
|
152
|
+
<td class="split2">
|
|
153
|
+
{#if own(f) > 0}
|
|
154
|
+
<div
|
|
155
|
+
class="ml"
|
|
156
|
+
title="markup {fmt_ms(f.markup_ms ?? 0)} ms · logic {fmt_ms(f.logic_ms ?? 0)} ms"
|
|
157
|
+
>
|
|
158
|
+
<div class="m" style="width:{((f.markup_ms ?? 0) / own(f)) * 100}%"></div>
|
|
159
|
+
<div class="l" style="width:{((f.logic_ms ?? 0) / own(f)) * 100}%"></div>
|
|
160
|
+
</div>
|
|
161
|
+
<span class="hint">{Math.round(((f.markup_ms ?? 0) / own(f)) * 100)}% markup</span>
|
|
162
|
+
{:else}—{/if}
|
|
163
|
+
</td>
|
|
164
|
+
{/if}
|
|
165
|
+
{#if hasParent}<td class="file">{f.parent ?? '—'}</td>{/if}
|
|
166
|
+
{#if hasRuns}
|
|
167
|
+
{@const sp = spread(f)}
|
|
168
|
+
<td
|
|
169
|
+
class="num runs"
|
|
170
|
+
title={(f.runs_ms ?? []).map((x, i) => `run ${i + 1}: ${fmt_ms(x)} ms`).join('\n')}
|
|
171
|
+
>
|
|
172
|
+
{#if sp}
|
|
173
|
+
{fmt_ms(sp.min)} · <b>{fmt_ms(sp.med)}</b> · {fmt_ms(sp.max)}
|
|
174
|
+
{#if sp.cold}<span class="tag cold">cold 1st</span>{:else if sp.flaky}<span
|
|
175
|
+
class="tag flaky">varies</span
|
|
176
|
+
>{/if}
|
|
177
|
+
{:else}—{/if}
|
|
178
|
+
</td>
|
|
179
|
+
{/if}
|
|
180
|
+
{#if hasAlloc}<td class="num">{f.alloc ? fmt_bytes(f.alloc) : '—'}</td>{/if}
|
|
181
|
+
</tr>
|
|
182
|
+
{#if open === f.name}
|
|
183
|
+
<FrameDetails {f} colspan={cols} {base} {dev} />
|
|
184
|
+
{/if}
|
|
185
|
+
{/each}
|
|
186
|
+
</tbody>
|
|
187
|
+
</table>
|
|
188
|
+
|
|
189
|
+
<style>
|
|
190
|
+
.tools {
|
|
191
|
+
display: flex;
|
|
192
|
+
gap: 12px;
|
|
193
|
+
align-items: center;
|
|
194
|
+
flex-wrap: wrap;
|
|
195
|
+
margin: 6px 0 8px;
|
|
196
|
+
}
|
|
197
|
+
.tools input {
|
|
198
|
+
font: inherit;
|
|
199
|
+
font-size: 13px;
|
|
200
|
+
background: var(--bg-raised);
|
|
201
|
+
color: var(--text);
|
|
202
|
+
border: 1px solid var(--line);
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
padding: 5px 10px;
|
|
205
|
+
min-width: 280px;
|
|
206
|
+
}
|
|
207
|
+
.tools .hint {
|
|
208
|
+
color: var(--text-faint);
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
}
|
|
211
|
+
tr.row {
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
}
|
|
214
|
+
tr.row:hover td {
|
|
215
|
+
background: var(--bg-raised);
|
|
216
|
+
}
|
|
217
|
+
tr.row.open td {
|
|
218
|
+
border-bottom-color: transparent;
|
|
219
|
+
}
|
|
220
|
+
.caret {
|
|
221
|
+
color: var(--text-faint);
|
|
222
|
+
font-size: 10px;
|
|
223
|
+
margin-right: 4px;
|
|
224
|
+
}
|
|
225
|
+
.split2 {
|
|
226
|
+
min-width: 120px;
|
|
227
|
+
}
|
|
228
|
+
.ml {
|
|
229
|
+
display: flex;
|
|
230
|
+
height: 8px;
|
|
231
|
+
background: var(--bg-hover);
|
|
232
|
+
border-radius: 3px;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
}
|
|
235
|
+
.ml .m {
|
|
236
|
+
background: #b48ead;
|
|
237
|
+
}
|
|
238
|
+
.ml .l {
|
|
239
|
+
background: #4a9d6e;
|
|
240
|
+
}
|
|
241
|
+
.split2 .hint {
|
|
242
|
+
color: var(--text-faint);
|
|
243
|
+
font-size: 11px;
|
|
244
|
+
}
|
|
245
|
+
.runs {
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
font-size: 12px;
|
|
248
|
+
}
|
|
249
|
+
.tag {
|
|
250
|
+
display: inline-block;
|
|
251
|
+
margin-left: 6px;
|
|
252
|
+
font-size: 10.5px;
|
|
253
|
+
border-radius: 999px;
|
|
254
|
+
padding: 0 6px;
|
|
255
|
+
line-height: 15px;
|
|
256
|
+
}
|
|
257
|
+
.tag.cold {
|
|
258
|
+
color: var(--c-blue);
|
|
259
|
+
border: 1px solid #2a3a5a;
|
|
260
|
+
}
|
|
261
|
+
.tag.flaky {
|
|
262
|
+
color: var(--warn);
|
|
263
|
+
border: 1px solid #5a4a20;
|
|
264
|
+
}
|
|
265
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Components table — a `wake:'load'` island with reactive column sort (was TABLE_SORT_JS + the
|
|
2
|
+
* string row builder). Sorts by self/total/per-call/alloc; a row expands to the component's
|
|
3
|
+
* full location and the call stacks that rendered it. */
|
|
4
|
+
import type { FrameStat } from '../analyze.js';
|
|
5
|
+
type Row = FrameStat & {
|
|
6
|
+
per: number;
|
|
7
|
+
count: number;
|
|
8
|
+
alloc: number | null;
|
|
9
|
+
};
|
|
10
|
+
type $$ComponentProps = {
|
|
11
|
+
rows: Row[];
|
|
12
|
+
busy: number;
|
|
13
|
+
hasAlloc: boolean;
|
|
14
|
+
maxTotal: number;
|
|
15
|
+
base?: string;
|
|
16
|
+
dev?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare const ComponentsTable: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
19
|
+
type ComponentsTable = ReturnType<typeof ComponentsTable>;
|
|
20
|
+
export default ComponentsTable;
|