perf(desktop): bound timing callback evidence

Record virtualizer and resize callback evidence only while a settle measurement
has an active subscriber, avoiding permanent User Timing growth and callback
instrumentation overhead after channel load settles.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
This commit is contained in:
Wes
2026-08-13 15:12:36 -06:00
co-authored by Carl
parent f2f716316c
commit db381e8a70
@@ -44,8 +44,13 @@ export function recordPerformanceMark(
name: string,
detail?: Record<string, unknown>,
): void {
const current = listeners.get(name);
// Callback evidence exists only while a settle measurement is active. This
// keeps normal scrolling/resizing from filling the User Timing buffer or
// doing instrumentation work for the rest of the session.
if (!current?.size) return;
performance.mark(name, detail ? { detail } : undefined);
for (const listener of listeners.get(name) ?? []) listener();
for (const listener of current) listener();
}
export function finishPerformanceMeasure(input: {
startMark: string;