Audit third-party scripts by main-thread cost
Third-party tags rarely show in your byte budget but dominate blocking time. Rank by CPU, not KB.
— Step 1: DevTools > Performance > Bottom-Up, group by domain. Sort by self time.
— Step 2: Lighthouse 'Reduce the impact of third-party code' gives blocking ms per origin.
— Step 3: Anything over 100ms main-thread: defer, lazy-load on interaction, or facade it (e.g. video embeds).
— Step 4: Move analytics to type=module or onload; never in blocking .
— Step 5: Re-measure Total Blocking Time.
Example: a chat widget cost 340ms main-thread for a feature 2% of users open — facade dropped TBT 510ms -> 190ms.
Takeaway: no single third party should exceed 100ms of main-thread blocking.
Millisecond Mafia
@MillisecondMafia
Audit third-party scripts by main-thread cost
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.