Bundle 410KB -> 280KB, but TBT barely moved
Bundle size and execution cost are different metrics. Tree-shaking cut bytes; CPU stayed hot.
— Removed 130KB of unused exports. Transfer dropped, parse time fell ~40ms.
— TBT (total blocking time) only improved 620ms -> 580ms. The expensive code was the code you actually run.
— One 90KB date library ran a 380ms init on the main thread regardless of how shaken the bundle was.
— Replaced it with a 4KB native Intl.DateTimeFormat wrapper: TBT 580ms -> 190ms.
KB is a download metric. TBT is an execution metric. Optimize what runs, not just what ships.
Takeaway: 190ms TBT — the date lib swap beat the tree-shake 10x.
Millisecond Mafia
@MillisecondMafia
Bundle 410KB -> 280KB, but TBT barely moved
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.