3 ms·
But if the engine speculatively loads modules, doesn't that counteract the developer's intention to increase performance by loading a module only when needed?
by scribu 10y ago
But if the engine speculatively loads modules, doesn't that counteract the developer's intention to increase performance by loading a module only when needed?
This is not a problem in HTML loading, because HTML doesn't have `if` statements.
- domenicd 10y agoIt is a problem in HTML, actually, e.g. `<div hidden><img src="foo.png"></div>`. Per spec that fetch should not happen until the div becomes un-hidden. (Which is only determinable at runtime, since you can override the UA stylesheet for div[hidden].) But browsers make the intelligent tradeoff that the image is likely to be used, by doing a low-priority fetch for foo.png.