From 08b95c3321c33bccc28f76c8e42057893adfb728 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin <5278175+alies-dev@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:17:40 +0100 Subject: [PATCH 1/2] feat: add the performance report viewer at /perf/ Static page that renders the JSON file written by `psalm --debug-performance=PATH` (vimeo/psalm#14737): timeline of stages, steps, pools and workers, hot code, plugins, files and memory. The file is read in the browser and never uploaded. --- perf/index.html | 1144 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1144 insertions(+) create mode 100644 perf/index.html diff --git a/perf/index.html b/perf/index.html new file mode 100644 index 0000000..1d811d2 --- /dev/null +++ b/perf/index.html @@ -0,0 +1,1144 @@ + + +
+ + + +traceEvents of old dumps.
+
+ Write the file with Psalm:
+psalm --debug-performance=perf.json
+ The file is read in your browser and sent nowhere.
+traceEvents of old dumps.
@@ -259,23 +258,23 @@ ${esc(e.config_sha256)}` : '');
+ kv('Restarted', e.restarted != null ? (e.restarted ? 'yes' : 'no') : '');
+ kv('Process id', e.pid != null ? esc(e.pid) : '');
kv('Trace context', e.traceparent ? `${esc(e.traceparent)}` : '');
kv('Options', Array.isArray(e.options) ? `${num(t.php_peak_bytes) ? `Peak PHP memory of the main process ${fmtB(t.php_peak_bytes)}` : ''}${num(t.max_rss_bytes) ? `, max RSS ${fmtB(t.max_rss_bytes)}` : ''}${t.children_max_rss_bytes ? `, largest child RSS ${fmtB(t.children_max_rss_bytes)}` : ''}.
+${num(t.php_peak_bytes) ? `Peak PHP memory of the main process ${fmtB(t.php_peak_bytes)}` : ''}${num(t.max_rss_bytes) ? `, max RSS ${fmtB(t.max_rss_bytes)}` : ''}.
${esc(r.node || '')}` },
]);
- mk('#hot-f', h.functions || [], 'Hottest functions and methods', `The ${(h.functions || []).length} function-likes that took longest. Own time is the function-like itself, total time includes the functions analysed meanwhile. A constructor is analysed twice, so it has more than one pass.${lim}`, [
+ mk('#hot-f', h.functions || [], 'Hottest functions and methods', `The ${int((h.functions || []).length)} function-likes that took longest. Own time is the function-like itself, total time includes the functions analysed meanwhile. A constructor is analysed twice, so it has more than one pass.${lim}`, [
{ k: 'id', label: 'Function', v: r => r.id || '', h: r => `${esc(r.id || '')}` },
{ k: 'pass', label: 'Pass', v: r => r.pass || '', h: r => esc(r.pass || '') },
]);
@@ -830,19 +819,18 @@