284
export function logYieldTime(startTime: number, endTime: number): void {
285
if (supportsUserTiming) {
286
const yieldDuration = endTime - startTime;
287
- if (yieldDuration < 1) {
287
+ if (yieldDuration < 3) {
288
// Skip sub-millisecond yields. This happens all the time and is not interesting.
289
return;
290
}
299
: 'error';
300
reusableComponentOptions.start = startTime;
301
reusableComponentOptions.end = endTime;
302
+ // This get logged in the components track if we don't commit which leaves them
303
+ // hanging by themselves without context. It's a useful indicator for why something
304
+ // might be starving this render though.
305
+ // TODO: Considering adding these to a queue and only logging them if we commit.
306
performance.measure('Blocked', reusableComponentOptions);
307
}
308
}
369
reusableLaneOptions.start = updateTime;
370
reusableLaneOptions.end = renderStartTime;
371
performance.measure(
368
- isSpawnedUpdate ? 'Cascade' : 'Blocked',
372
+ isSpawnedUpdate
373
+ ? 'Cascading Update'
374
+ : renderStartTime - updateTime > 5
375
+ ? 'Update Blocked'
376
+ : 'Update',
377
reusableLaneOptions,
378
);
379
}
419
reusableLaneDevToolDetails.color = 'primary-light';
420
reusableLaneOptions.start = updateTime;
421
reusableLaneOptions.end = renderStartTime;
414
- performance.measure('Blocked', reusableLaneOptions);
422
+ performance.measure(
423
+ renderStartTime - updateTime > 5 ? 'Update Blocked' : 'Update',
424
+ reusableLaneOptions,
425
+ );
426
}
427
}
428
}
599
reusableLaneDevToolDetails.color = 'secondary-light';
600
reusableLaneOptions.start = startTime;
601
reusableLaneOptions.end = endTime;
591
- performance.measure('Suspended', reusableLaneOptions);
602
+ // TODO: Make this conditionally "Suspended on Images" or both when we add Suspensey Images.
603
+ // TODO: This might also be Suspended while waiting on a View Transition.
604
+ performance.measure('Suspended on CSS', reusableLaneOptions);
605
}
606
}
607