Hacker News new | ask | show | jobs
by AshleysBrain 4432 days ago
New architectures like the Mill (http://millcomputing.com/) could provide alternative ways to a breakthrough increase in performance.

On the software side, I've always understood browsers are pretty good at parallelism, which is a pretty major platform that gets performance benefits. That could also extend even further with projects like Mozilla's Servo (https://github.com/mozilla/servo), a browser engine built from the ground up with parallelism in mind.

1 comments

Yet JavaScript is fundamentally single threaded by design...
I don't think that's actually true. The way it use asynchronous callbacks allows for lots of parallelism. For example creating a new image will cause it to download the image off the network and decompress it in parallel to executing Javascript, and then when done it fires the 'onload' handler. That's much more parallel-by-design than something like C++.
Unfortunately you can't actually run those callbacks in parallel, because of JavaScript's run to completion model.

The work we're doing with PJs, however, attempts to fix this problem :)

Take a look at Chromium as an example. Every tab gets it's own process. The GPU gets it's own process. Every plugin object gets its own process. Page loading is done in a separate process. Web workers run in a separate process. Chromium will happily eat up every core your CPU has to offer.
If you're running multiple tabs at the same time and actually interacting with both. But most of the time you're only laying out and rendering one page at a time; your browser actually only displays one tab at a time, after all.