perf(#306): measure cumulative sync time per frame code
The conversation-load metric was misread, and nearly caused a fix to the wrong thing. It reported store=30138ms across 300 contacts, which looked like loadMessages costing ~100ms each. It is not: - The device-wide fallback key `messages_<dev>` does not exist on the reporting machine, and only 11 per-contact message keys exist in total, so loadMessages does three in-memory map lookups and returns empty. - storeWatch spans an `await`, so it measures WALL time including event-loop queueing, not work. merge, which is synchronous and has no await, measures 0ms - consistent with the isolate being busy elsewhere while those awaits wait their turn. So the 30s is ~300 awaits each waiting for a busy isolate, not 30s of storage work. The metric label now says so, rather than inviting the same misreading. The per-call 100ms threshold cannot see the actual shape here: a handler that takes 40ms and runs 234 times owns ~9s of isolate time and never trips it. Frame handlers now accumulate synchronous time per frame code and report the top codes by total, which names the owner regardless of per-call cost. Diagnostics only, no behaviour change. flutter analyze clean, dart format clean, 494 tests pass.integration/290-306-335
parent
30ab360d66
commit
77625db575
Loading…
Reference in new issue