logoalt Hacker News

Rohansiyesterday at 8:50 PM8 repliesview on HN

> This is the kind of thing usually a human notices and says 'dont do that, that is kind of crazy'.

It's not crazy. That is literally what 99.99% of video games do. They repaint everything constantly, only limited by either your vsync rate or hardware.


Replies

Philip-J-Fryyesterday at 9:48 PM

A website shouldn't be pinning CPU or GPU. When people run a game they expect some sort of battery drain. People don't expect that some websites will thrash your CPU/GPU like a game.

show 1 reply
goobatroobayesterday at 11:46 PM

> Yes my car is running all night while it stands in front of my house, but it's not really a waste of resources or a nuisance because generators do the same thing.

show 3 replies
adithyassekhartoday at 2:07 AM

The state of the web when you want to compare a website to the most intensive thing a pc can do.

pennomiyesterday at 8:57 PM

Presumably in a video game the majority of the screen changes every frame. Not so in web pages.

show 1 reply
hbcdbffyesterday at 9:07 PM

A website isn’t a videogame

show 1 reply
yesithinksotoday at 2:19 PM

I get what you're saying.

These downvoters act like native JS doesn't do the exact same thing with event listening and observing the DOM. So does React and other FE frameworks.

Philip J Fry is either being disingenuous or genuinely doesn't know that game rendering has often several MB models, is often raycasting, maintaining camera calculus, and a lot more.

holoduketoday at 1:42 PM

If you take about optimizing then games are the prime example of doing that. You don't load textures every frame into gpu memory. Tou don't load vertices into memory every frame. Sure they repaint every pixel every frame. But low level your display driver is doing that anyway. The cpu cycles are not in sending the RGB value to each pixel. We are far beyond that bandwidth issue. Recalculating every single position in a css styled document is pretty heavy. There are millions of calculations done to solve flex boxes, floats, percentual widths etc. this example is doing something like that. Super heavy. Super inefficient. Super bad.

moralestapiayesterday at 10:37 PM

The browser and OS does that as well (unless absolute zero updates and you don't even move your pointer around).

But many smaht people out there don't know that.

show 1 reply