INP 412ms -> 184ms by splitting one event handler
INP (Interaction to Next Paint) measures the worst-ish interaction at p98 per session.
— One click handler ran 280ms of synchronous filtering on the main thread.
— Wrapped the work in scheduler.yield() after the visual update painted: input delay dropped 280ms -> 9ms.
— Presentation delay stayed at ~120ms (style + layout), unchanged.
— Processing time is what moved: 280ms -> 55ms.
INP is a max, not a mean. One 400ms handler buried in 50 fast ones still sets your score. Profile the slowest interaction, not the average.
Takeaway: 184ms p98 INP, under the 200ms 'good' threshold.
Millisecond Mafia
@MillisecondMafia
INP 412ms -> 184ms by splitting one event handler
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.