Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you have a rough idea whether doing this on the GPU is worth it on mobile devices with regards to energy consumption? I imagine many typical web and UI toolkit uses of this aren't limited by raw performance.


Yes, but only from first principles, and my first rule is always "measure it, then explain it, lest you look foolish". TL;DR: 100% worth it

(claim to knowledge: from time on Android watches, incl. building an automated power testing framework at Google, left in October)

- Power cost optimization is found by handwaving avoiding something spinning up, or due to very long actions (i.e. 5+ seconds)

- The GPU is already running if a frame is due to be rendered.

- If we're running drawing code that draws a stroke, a frame is due to be rendered. Therefore the additional cost to run the stroke render can be considered infinitesimal

- Its unintuitive how much power savings can be achieved by "racing to zero" (i.e. doing something faster)

- The algorithm is a better racer to zero because it runs in parallel


+1 to always measuring. That said, we have done some experiments regarding power, including on Android, and it looks favorable.

The general rule of thumb is that a GPU has about 10x the raw throughput per joule as a CPU (which, today, is basically the same metric as throughput per dollar). So if your GPU is only barely faster than the CPU because of overheads of the parallel algorithm, you might not win, but if it sails way past the CPU because it's work efficient and lean (as I believe this work is), you do win both on power and throughput (frames per second).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: