3 ms·
It's actually hard for a browser to utilize multiple cores, because Javascript and DOM designed for one thread: While javascript runs the layout shall not be re
by atesti 13y ago
It's actually hard for a browser to utilize multiple cores, because Javascript and DOM designed for one thread: While javascript runs the layout shall not be recalculated. When you click and an onclick handler fires and JS runs, the browser cannot run other JS of the same tab in parallel. While HTML is parsed any time a inline script could come and block processing the rest of the document.
Chrome and other browsers of course work hard against that: There is a second fast parser which heuristically finds ressources to preload and Chrome just switched to blink in order to do the parsing and something else in parallel and now they want to do CSS calculations in threads, too, which is hard.
There was a story here about it recently:
https://news.ycombinator.com/item?id=5895729 https://news.ycombinator.com/item?id=5895729