THN Interview Prep

Profiling the browser

Core details

Goal: decide if the problem is script, layout, paint, network, or memory—then change one thing and re-measure.

Chromium Performance workflow (repeatable)

  1. Record one clean interaction (no extra extensions).
  2. Identify long tasks (>50 ms blocks)—they delay input and frame delivery.
  3. Bottom-up: sort JS by self time; jump to call tree for hot stacks.
  4. Markers for Recalculate Style, Layout, Paint—map to code that reads geometry after writes or heavy selectors.
  5. Network track: LCP candidate, priority, blocking resources.
  6. Frames view: dropped frames vs GPU composite cost.

Common classifications

SignalOften is
Long purple Layout barsforced sync layout / thrash
Long Scriptmain-thread compute; consider chunk or worker
LCP lateslow TTFB, render-blocking CSS/JS, huge image without priority
Memory sawtoothallocation churn; snapshot diff for dominators

Understanding

The browser batches work until it must paint—or until JS forces layout. Profiling without this model leads to “memo everything” theater while the real issue is getBoundingClientRect in a scroll handler.

Lab (Lighthouse) catches regressions; CrUX validates field reality on real devices and networks.

Senior understanding

TrapRecovery
Optimizing JS while layout dominatesbatch reads/writes; reduce invalidation
will-change everywhereGPU memory pressure; validate Layers panel
Ignoring INP / interactionlong tasks block input responsiveness

Diagram

Loading diagram…

See also

Last updated on

Spotted something unclear or wrong on this page?

On this page