mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user