Performance·Advanced·Coding·1 min read
What causes a large decode cost even when an image downloads quickly?
Short interview answer
Very high-resolution images take significant main-thread time to decode into a bitmap, which can jank scrolling or delay paint. Serving appropriately sized images avoids it; decoding="async" can also let the browser schedule the decode off the critical path.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.