Live data from Hacker News

RenderingNG: An architecture that makes and keeps Chrome fast for the long term

blog.chromium.org

101–110 of 161 posts

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#101

Earlier quoted context omitted.

Both Nvidia (and AMD?) have options to reduce latency to like 1 frame (edit: due to render ahead queue; not total latency) in their control panels. You probably pay for it with a bit of stutter when your system is pushed to the max - since there is no leeway buffer when frames don’t get finished in time. Display latency from LCDs are another factor - something that was completely absence on CRTs.

That actually isn't particularly helpful. Picture the rendering process like a conveyor belt factory. This is a bit of a simplified model, GPUs are incredibly complex and things aren't quite this straightforward, but it's good enough way of reasoning about how they operate by imagining something like Factorio. First you load up a scene, and then it goes into one machine that does the first part of the rendering, then…

Having one more "spare" slot on the belt (e.g. triple- instead of double-buffering) can help to smooth over unpredictable spikes caused by other systems, but it always costs one more frame of latency even if the spare slot isn't usually needed.

In game engines, long frame pipelines were all the rage in the early 2000's to distribute work across CPU cores without having to rewrite entire single-threaded systems to multithreading (so you might have a pipeline of input-, AI-, physics- and render-thread, each adding one frame of latency).

But that's also when "input latency" became a problem, so game engines went away from this pipeline architecture and ran all those steps in a single frame by parallelizing within systems, but still chaining the inputs and output of those big systems together in a linear sequence (but all ideally within one frame).

After that came the general task schedulers, where everything that needs to happen in one frame is split into very small tasks arranged in a dependency tree, and those small tasks are run by a general task scheduler running on a thread pool (sometimes even on the GPU).

The general goal is to distribute the same work across available CPU and GPU resources, but without introducing a deep frame pipeline, and for the only reason to reduce button-to-screen latency (while still cramming as much work as possible/needed onto the CPU and GPU).

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#102

Earlier quoted context omitted.

The pipeline rendering architecture is probably also in part to blame. It doesn't degrade particularly gracefully. Modern GPUs have staggered rendering where one frame is rendered while the previous frame is postprocessed (that's a bit simplified, it's more like a waterfall with a bunch of different steps). That sort of a conveyor belt-like operation always induces latency, and a struggling GPU increases the time it…

Both Nvidia (and AMD?) have options to reduce latency to like 1 frame (edit: due to render ahead queue; not total latency) in their control panels. You probably pay for it with a bit of stutter when your system is pushed to the max - since there is no leeway buffer when frames don’t get finished in time. Display latency from LCDs are another factor - something that was completely absence on CRTs.

> Both Nvidia (and AMD?) have options to reduce latency to like 1 frame in their control panels.

In case you are referring to pre-rendered frames, this only affects the amount of additional latency (not actual or total latency).

> You probably pay for it with a bit of stutter when your system is pushed to the max - since there is no leeway buffer when frames don’t get finished in time.

True, if your system is not maxed out, you can enable Triple Buffering. If your rendering framerate is higher than your display, it will discard obsolete frames and only push the most recent one to the display.

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#103

How come processors and browsers become faster every year but the internet feels as slow and bloated as ever? How long can this x% faster continue? There must be some theoretical optimum, how far are we away?

What the browser giveth, the web developer taketh away. I tremendously hate it and it’s not like developers are incapable of building performant software, quite the opposite. But that’s just not where the resources go. The common sentiment (I have heard this directly uttered) is “If the user has 8GB of RAM, why wouldn’t I use it?”.

IMO the frontend JavaScript ecosystem is a complete mess. Nobody cares about maintaining things properly or backwards compatibility. I mostly do backend, but occasionally do frontend work, and whenever I do I feel like bashing my head against a wall.

Case in point: Early last year I created a proof of concept web app that needs to run in the browser and a webview on an old version of Android. I used create-react-app which at the time was the most popular way to... create React apps. This year I updated all the deps and something in the build broke meaning it no longer produces something runnable on the old version of Android we need. There's been an open issue on create-react-app for nearly a year, however it seems Facebook have abadoned that project and everyone has switched to Vite/Rollup now. I spend half a day switching to that which mostly works, except as it doesn't actually bundle, the dev build no longer works on the Android webview - but that's not such a deal breaker. However in the production build treeshaking seems to be completely broken, so the resulting build is a few mb instead of a few hundred kb.

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#104
post #13
post #3

Earlier quoted context omitted.

Chrome became so bloated and crap and slow that in 2020 I moved over to Firefox (which has been imperfect, but better), so my anecdata suggests that browsers don't actually get faster overall, but ebb and flow as feature creep and optimization compete for dominance.

To me it feels like bloated browser profiles makes the browsers sluggish. I get annoyed with how slow Chrome is, so I switch Firefox. After a while the Firefox profile gets bloated and I get annoyed and switch back to Chrome with a clean profile and it feels really quick again. Ad infinitum.

The fix for 99% of firefox problems is: firefox -p, make a new profile

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#105
Does anyone here know whether/how this should affect WebGL rendering?

I'm developing a browser-based 3D game, and since a week or two ago I've noticed the rendering on mac/chrome is way slower than before. In fact my game now seems to be GPU-bound, where up to now it's always been CPU-bound. I think this started right around Chrome 94 shipped, but it's hard to downgrade and check. This is only on mac; PC performance doesn't seem to have changed.

TFA makes it sound like whatever is new in v94 is only about page rendering, not WebGL, but does anyone know for sure?

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#106

Earlier quoted context omitted.

Both Nvidia (and AMD?) have options to reduce latency to like 1 frame (edit: due to render ahead queue; not total latency) in their control panels. You probably pay for it with a bit of stutter when your system is pushed to the max - since there is no leeway buffer when frames don’t get finished in time. Display latency from LCDs are another factor - something that was completely absence on CRTs.

That actually isn't particularly helpful. Picture the rendering process like a conveyor belt factory. This is a bit of a simplified model, GPUs are incredibly complex and things aren't quite this straightforward, but it's good enough way of reasoning about how they operate by imagining something like Factorio. First you load up a scene, and then it goes into one machine that does the first part of the rendering, then…

> But you could (hypothetically) render at 120 Hz refresh rate with a 30 second rendering latency.

This is an important point. A 120Hz refresh rate causes _at least_ a worst-case latency of 8ms. People often drop the "at least" or ignore that latency compounds across the pipeline.

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#107
post #99

Earlier quoted context omitted.

I agree, but tell that to the "money people" in big game studios ;) The web simply isn't on their radar, even mobile isn't for the most part. They want strong centralized platforms like Steam, EGS, Xbox, Playstation or Nintendo and a platform owner to negotiate with. This can change very quickly if there's actually some breakthrough web game, but that hasn't happened so far, and nobody wants to be the first to take t…

Both Unreal Engine and Unity already have Google Stadia for a compile target ( Debian/vulkan )and it runs in the browser. As consoles have become more and more generic and all carry a browser, less money is being invested in platform specific engines because there is less relative performance increase & return on investment compared to the past. ( Games sold the platform, not the other way round ) Risks have been tak…

> ...and it runs in the browser

That's not correct though, the game runs on a Linux box in Google's datacenters (granted, from a business perspective that's nitpicking - but not quite, see below, but it's a massive difference from a technical perspective).

Scaling to large audiences is much more expensive with the game streaming approach though (but we'll never really know because Stadia bombed, just as all other game streaming platforms before).

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#108

Does anyone here know whether/how this should affect WebGL rendering? I'm developing a browser-based 3D game, and since a week or two ago I've noticed the rendering on mac/chrome is way slower than before. In fact my game now seems to be GPU-bound, where up to now it's always been CPU-bound. I think this started right around Chrome 94 shipped, but it's hard to downgrade and check. This is only on mac; PC performance…

I've also seen a somewhat recent performance degradation on MacOS+Chrome in WebGL when the WebGL canvas is close to fullscreen size, and even for extremely simple scenes (it's inconsistent though, maybe related to remaining battery life?). My guess is that this is some problem in the interfacing between Chrome and macOS, or purely in macOS though, because other platforms are fine.

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#109

How come processors and browsers become faster every year but the internet feels as slow and bloated as ever? How long can this x% faster continue? There must be some theoretical optimum, how far are we away?

What the browser giveth, the web developer taketh away. I tremendously hate it and it’s not like developers are incapable of building performant software, quite the opposite. But that’s just not where the resources go. The common sentiment (I have heard this directly uttered) is “If the user has 8GB of RAM, why wouldn’t I use it?”.

Even if the developers working on a website care about performance, the company’s marketing department won’t. Unless the manager in charge of the developers is particularly good, marketing will be better at convincing management to do things their way than the developers.

Re: RenderingNG: An architecture that makes and keeps Chrome fast for the long term

#110

Earlier quoted context omitted.

That actually isn't particularly helpful. Picture the rendering process like a conveyor belt factory. This is a bit of a simplified model, GPUs are incredibly complex and things aren't quite this straightforward, but it's good enough way of reasoning about how they operate by imagining something like Factorio. First you load up a scene, and then it goes into one machine that does the first part of the rendering, then…

Having one more "spare" slot on the belt (e.g. triple- instead of double-buffering) can help to smooth over unpredictable spikes caused by other systems, but it always costs one more frame of latency even if the spare slot isn't usually needed. In game engines, long frame pipelines were all the rage in the early 2000's to distribute work across CPU cores without having to rewrite entire single-threaded systems to mul…

> Having one more "spare" slot on the belt (e.g. triple- instead of double-buffering) can help to smooth over unpredictable spikes caused by other systems, but it always costs one more frame of latency even if the spare slot isn't usually needed.

This is not correct:

If your application frame rate is higher than your display refresh rate, triple buffering has lower latencies than double buffering. This is due to much more frames being rendered (and most of them discarded) so that the average age of the last frame rendered before being sent to the display is much younger (but never older) as in double buffering.

In terms of latency: VSYNC off < Triple Buffering < Double Buffering.

Post reply on HN