History

Track large-thread render timings in desktop perf trace

- Seed each perf project with a large synthetic thread for stress coverage - Measure thread-switch render latency/message counts via ChatView data attributes - Include a Large Thread Render table in `desktop-perf-trace` markdown output

Julius Marminge committed 8 months ago

Commit 41caab91 parent 25cc1393 files · +140 −1Browse files

Showing the changes to scripts (1 of 3 files). Show all

Unified · Split

scripts/desktop-perf-trace.mjs+13−0
@@ -162,6 +162,9 @@ function summarizeTrace(tracePath) { · 161 unmodified lines
162162 }
163163
164164 function createMarkdownSummary({ tracePath, donePayload, summary, thresholds }) {
165+ const largeThreadRenderStats = Array.isArray(donePayload.interactions?.largeThreadRenderStats)
166+ ? donePayload.interactions.largeThreadRenderStats
167+ : [];
165168 const lines = [
166169 marker,
167170 "## Desktop Dev Perf Trace",
@@ -178,6 +181,16 @@ function createMarkdownSummary({ tracePath, donePayload, summary, thresholds }) · 10 unmodified lines
178181 `- Typed chars: ${donePayload.interactions?.typedChars ?? "n/a"}`,
179182 `- Model selected: ${donePayload.interactions?.selectedModel ?? "n/a"}`,
180183 "",
184+ "### Large Thread Render",
185+ "",
186+ "| Thread | Messages | Render (ms) |",
187+ "| --- | ---: | ---: |",
188+ ...(largeThreadRenderStats.length > 0
189+ ? largeThreadRenderStats.map(
190+ (stat) => `| ${stat.threadId} | ${stat.messageCount} | ${stat.renderMs} |`,
191+ )
192+ : ["| n/a | n/a | n/a |"]),
193+ "",
181194 "### Input Event Metrics",
182195 "",
183196 "| Event | Count | Avg (ms) | Max (ms) | Total (ms) |",