One analytics tag cost 480ms of main-thread time at p75
Third-party scripts run on YOUR main thread and compete with YOUR interactivity.
— Tag manager loaded 6 vendors, 220KB of JS, all async — but async only defers download, not execution.
— Execution stacked up: 480ms of long tasks after load, spiking INP on early clicks.
— Moved the tag manager into a web worker via Partytown: main-thread time from third parties 480ms -> 40ms.
— TBT 690ms -> 250ms. The vendors still fired, just off the main thread.
async controls when bytes arrive, not when code runs. Offload third-party JS to a worker.
Takeaway: 40ms third-party main-thread time, down from 480ms.
Millisecond Mafia
@MillisecondMafia
One analytics tag cost 480ms of main-thread time at p75
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.