Skip to content

Comment on Recreating macOS’s Drift Screensaver with Rust and WASM

Comments

Are these screensavers designed to be impressive and fun while also requiring minimal processor (battery)?

I always assumed the screensavers that ship with the Mac are carefully designed not to unnecessarily drain the battery, but I realised just now that’s just an assumption.

I guess screensavers are something for nineties nostalgics nowadays, because no screensaver can be as battery friendly as turning the screen off completely. Ok, maybe you can enable the screensaver only when your laptop is on AC power, but that's one extra configuration step that not many make...

The older ones are pretty lightweight shaders, and don't seem to tax the machine that much. Drift would heat up my Intel Mac pretty quickly though (~70c, 80c if connected to an external monitor), but presumably only because the iGPU was struggling. I'd be curious to profile the official program and see what's hogging the GPU so much...

I'd be curious to profile the official program and see what's hogging the GPU so much...

It's a fluid simulation. Compute shaders, compute shaders, compute shaders.

Right, but a lot of those shaders will run fine on the CPU as opposed to the GPU. Especially with the current lineup of supported Intel Macs, there's pretty much no supported machines that don't have comprehensive vector computation pipelines on the CPU-side of things.

IMO the best balance would be maxing out the AVX pipeline but keeping the CPU at base clock, and then leave the rendering/framebuffer manipulation to the GPU. I suspect that running both the simulation and 5k/2k displays simultaneously is too much for the GPU to handle.

GPUs are multiple orders of magnitude faster than a CPU's max theoretical throughput. If a GPU is slowing down the solution is a faster GPU, the CPU won't be able to help out much at the same stuff.

But if the problem is power usage couldn't running slower on the less powerful chip be better?

You think running on a CPU would save power? CPUs are the least power efficient because they are the most general. You should put some numbers on 'running slower' and 'less powerful'. GPUs for the same power are going to have about 20 times more single precision floating point operations.

Even though running a screensaver on battery seems ridiculous at first, it might be cool to try to come up with a battery friendly design. It might need laptop screen hw that works in ambient light without backlight and changes patterns very slowly.

On a tangent and not really related, but I noticed the port of the ATV screensaver Aerial for Windows would tax my PC somewhat and cause the fans to spin up :-)

I think it did on the Mac too - but don’t quote me…

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.