Live data from Hacker News

The web at maximum FPS: How WebRender gets rid of jank

hacks.mozilla.org

181–190 of 212 posts

Re: The web at maximum FPS: How WebRender gets rid of jank

#181

> What if we stopped trying to guess what layers we need? What if we removed this boundary between painting and compositing and just went back to painting every pixel on every frame? This feels a bit like cheating. Not all devices have a GPU. Would Firefox be slow on those devices? Also, pages can become arbitrarily complicated. This means that an approach where compositing is used can still be faster in certain circ…

To address your second point, you seem to be saying that missing the frame budget once and then compositing the rest of the time would be better than missing the frame budget every time. That is certainly true, but a) the cases where you can do everything as a compositor optimization are very few (transform and opacity mostly) so aside from a few fast paths you'd miss your frame budget all the time there too, and b)…

> To address your second point, you seem to be saying that missing the frame budget once and then compositing the rest of the time would be better than missing the frame budget every time. That is certainly true

I'm not even sure. The frame rate is important for smoothness, but the regularity is also important : reading a video with at a consistent 30fps rate is more pleasant than running a 60fps animation and dropping a frame every 2 seconds.

Re: The web at maximum FPS: How WebRender gets rid of jank

#182
post #57
post #31

Earlier quoted context omitted.

A modern high-end GPU can draw upwards of 200w. Edit: Not sure why I'm being downvoted for stating a simple fact. The top-of-the-line AMD and NVidia cards have TDPs of 200-250w.

Your comment is both true and utterly irrelevant to the person you replied to who asked about comparison between CPU and GPU efficiency. The important information to answer the question is how much power the GPU will use, not how much it can use.

But how much it can use gives you an upper limit on how much it will use. To boot, that also gives you an idea of how much power one can expect to draw under full load at any given time over any given time frame.

Re: The web at maximum FPS: How WebRender gets rid of jank

#183

Earlier quoted context omitted.

With a compositor you're already drawing every pixel every frame on the GPU, whether it's just a cursor blinking or not. The WR approach basically only adds a negligible amount of vertex shading time.

It seems like even in the compositor approach, you could optimize that. copy the last last drawn frame buffer directly and then modify it. I think the best approach would be some hybrid between invalidation and redrawing everything.

IIRC GPUs already do a more efficient version of what you're proposing, at least the mobile ones, by using tile-based rendering. Thus only the general area of the screen that changes gets modified while the remainder is static. This way you can easily control how many GPU cores are actively changing and thus need power, while you keep the static state in the other cores and they consume negligible power.

Re: The web at maximum FPS: How WebRender gets rid of jank

#184
post #108
post #87

Earlier quoted context omitted.

I've been working professionally with Rust for a year now. When I got over the first wall, it has become the best tool I've had for creating backend applications. I have history with at least nine different languages during my professional career, but nothing comes close giving the confidence and ergonomics than the tools Rust ecosystem provides. Firefox, especially the new Quantum version is awesome. But Rust as a s…

nice! can you talk more about Rust's tooling? How do you debug? What IDE or text editor do you feel comfy with? Do you have/use/need autocomplete? I'm coming from a a Python background and I'm too spoiled by Pycharm's insane tooling and autocomplete and stuff.. I wanna trail de Rust path too! thanks in advance.

I'm not pimeys, but on the debugging question:

I use rr for debugging (with gdb's command-line UI; I wish a GUI like Eclipse supported rr).

I can't emphasize enough that trying rr is worthwhile if you are developing in a language that gdb supports (not just Rust but C and C++, too).

Re: The web at maximum FPS: How WebRender gets rid of jank

#185
post #159

Earlier quoted context omitted.

I'm pretty sure they are aware of it. I have the same issues on Linux. It's really fast, but often it hogs one core completely and the CPU does a lot of work, sending the fans in overdrive. Especially when videos are involved. Let's hope things get ironed until a stable release in november

We're aware that there seems to be a problem, but we can't reproduce it yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1404042 Any additional data points, test cases etc. are appreciated.

I filed a new report here, with perf.html attached: https://bugzilla.mozilla.org/show_bug.cgi?id=1407536

Re: The web at maximum FPS: How WebRender gets rid of jank

#186

Earlier quoted context omitted.

I'm pretty sure they are aware of it. I have the same issues on Linux. It's really fast, but often it hogs one core completely and the CPU does a lot of work, sending the fans in overdrive. Especially when videos are involved. Let's hope things get ironed until a stable release in november

As said in sibling: Open a bug report at https://bugzilla.mozilla.org/ Mention Quantum Flow and "performance" in it. Make sure to attach a performance profile with https://perf-html.io/ using the linked add-on there. I had many cases where the mozilla devs were glad about such bug reporst (especially if you are on Linux - I am too :) - which is not so often used and reported like Windows or Mac)

Done: https://bugzilla.mozilla.org/show_bug.cgi?id=1407536

Re: The web at maximum FPS: How WebRender gets rid of jank

#187
post #31
post #22

Earlier quoted context omitted.

Despite the huge fans and heatsinks on modern desktop GPUs, I presume that a GPU would still use less energy than a CPU for the same workload, yes? Do mobile GPUs have a sleep mode comparable to mobile CPUs? Completely agreed that some measurements would be nice.

A modern high-end GPU can draw upwards of 200w. Edit: Not sure why I'm being downvoted for stating a simple fact. The top-of-the-line AMD and NVidia cards have TDPs of 200-250w.

High end desktop CPUs draw around 90W and 200W GPUs can do one or two orders of magnitude more computation in specialised workloads than CPUs.

Re: The web at maximum FPS: How WebRender gets rid of jank

#188

Earlier quoted context omitted.

The GPU is still painting the screen at a set refresh rate (your monitor’s). Some monitors have variable refresh rates, but don’t go any lower than 30hz, and depending on settings like vsync the gpu might still be churning through hundreds of wasted frames. The latest iPads can go down to 24hz to save energy due to their custom 120hz display, but that’s a rarity.

Let's clarify, WebRender doesn't do anything at all if nothing changed. If the content of the window is static then webrender won't wake your gpu up until it really needs to. There seem to be a confusion about video games needing to render at constant frame rate, but that is only the case in games where there is always something changing on screen. It isn't that uncommon for other types of games with more static grap…

What about if a tiny thing changes? Perhaps animated avatars totaling 1% of the page. Is that a scenario where the new method might use more power, because it redraws too much?

Re: The web at maximum FPS: How WebRender gets rid of jank

#189
This is great! I'm really impressed by the technical achievement, and hope everyone takes lessons from it to put performance and FPS at the forefront of their concerns when developing applications.

Sadly, seeing the state of the industry, people will just use this as an excuse to continue write more and more sloppy code that would perform terrible even on the newest and faster WebRender version.

In other words, this version might run current websites at 60 fps. But wait a few years, and it will become the norm that a lot of websites render at 10fps or less.

There should also be a way to punish developers who fail to run their sites at 60fps on WebRender, similar to how browsers will start to punish sites that run without https.

For example, if a site fails to run at 60fps for a few seconds, show some kind of alarm on the address bar that this site is very slow and might crash the browser.

Re: The web at maximum FPS: How WebRender gets rid of jank

#190
post #13

Now that this is closer to shipping, I'm curious what impact this would have on battery life. On the one hand, this is lighting up more silicon; on the other hand: a faster race to sleep, perhaps? Have there been any measurements on what the end result is on a typical modern laptop?

Power consumption is super-linear with clock speed. This means that in general splitting work from one core on to two cores running at half the speed will save power.

I would expect that in the long term, GPU rendering would be more efficient. In the short term the fact that the CPU is having to do a lot of work to manage the GPU may make it less efficient.

Post reply on HN