4 ms·
Not just in a single thread, in the same thread as DOM rendering. It's conceptually impossible to use a website in the time the javascript executes (except for
by wongarsu 8y ago
Not just in a single thread, in the same thread as DOM rendering. It's conceptually impossible to use a website in the time the javascript executes (except for webworkers etc).
Still, javascript issues tend to cause too many hangups of other parts (browser UI or other websites). We are in the awkward position where OS threads are considered too heavyweight to use an entire thread for each tab, but browsers haven't implemented a more lightweight alternative either. So things just share threads when they really shouldn't.
- pythonaut_16 8y agoBrowser green threads could be amazing! Specifically an Erlang/Elixir-ish actor async implementation
- the8472 8y agolayout and rendering can happen asynchronously in background threads, but you have to carefully structure your JS code to not read back layout properties any time soon after modifying the dom, otherwise it will block and turn everything back into sequential execution