The Parallel Future Of The Browser

You have on the CPU there are hundreds or thousands of them but they can’t do things independently they have to all be working at the same time on the same thing you need to do a lot of planning if you want to maximize the amount of work that they can do at the same time and that’s what web.

Render does so with web render we can get rid of performance cliffs that trip up web developers for example if you.

Anime background color right now your animations start can start and stop it can get janky it can make it look janky because the paint and composite phase have too much work to do and because of this there are currently a lot of rules about what you should and shouldn’t animate we’re going to be able to get rid of a lot of those rules so web developers don’t.

Need to hack around these performance cliffs we can take pages that render in.

Chrome today at 15 frames per second and bring them up to maximum fps whether it’s 60 frames per second.

Or 120 frames per second but it’s not just the browser’s own code that the browser.

Is going to need to run faster it’s also going to need to run application code faster so what I’m talking about here is stuff like JavaScript now the JavaScript engine is a part of this pipeline that I haven’t talked about yet so let’s see where it fits in JavaScript gives you a way to change the.

Document object model so that’s the thing that you built up that family tree wit that we built up during.

The the parsing phase when you change the Dom it triggers the creation of a new version of the page through this pipeline a lot of sites these days are pretty JavaScript heavy that’s where they spend a lot of the time that they have for figuring out what the new page should look like.

These things are using frameworks like react which does a lot of calculations in JavaScript.

To figure out what changes it needs to make to the Dom.

Now browsers can make the JavaScript engines that run this JavaScript faster but JavaScript isn’t really designed for it to be easy to run quickly.

Instead it’s designed to be easy for humans to write the way that Jay s engines get fast is by making guesses about where they can take shortcuts with your code but sometimes those guesses don’t work out for your code so it could actually make your Co slower and there are only so many guesses there are only so many shortcuts that it can.

Make which means that there’s only so much that the jas engine.

Can do to speed up this application code but what if application code could run in parallel what if application code could take advantage.

Of these multiple cores in the same way that the browser’s own code is doing over the past few years browsers have been adding features that make this possible one that you may have heard of before is called web workers and those have been in browsers for a few years now they allow you to have J’s code which runs on different cores you may have also heard of shared array buffers which started landing in browsers this past summer those give you the shared memory that I was talking about which you.