News for hackers. Stuff that matters.
Re:Advice for the next 100 Rust GUIs by kragen on Sunday November 22, 2026 @11:08AM (#50600912)
Even without the GPU, you don't have to peg the CPU when scrolling a 4K 120Hz display. 3840 pixels/row × 2160 rows/frame × 120 frames/second × 4 bytes/pixel is 4 gigabytes per second. The laptop I'm typing this on can memcpy() to main memory at 10 gigabytes per second on one core and 17–19 gigabytes per second on two cores. So we're talking about more like a 25% CPU load if we can avoid extra copies, maybe better than that if most of the work is something like colormapping 8-bit grayscale font-glyph pixels.

Using a GPU is of course much better, but not necessary to reach the level of performance you're talking about.

Re:Advice for the next 100 Rust GUIs by grg0 on Sunday November 22, 2026 @05:45PM (#50604780)
4 bytes per pixel? You forgot HDR!

But jokes aside, the math is sound and people underestimate or simply do not understand how much a CPU can lift with the right data structures and vectorization.

Re:Advice for the next 100 Rust GUIs by ben-schaaf on Sunday November 22, 2026 @06:41PM (#50605345)
Real applications don't use 8 bit grayscale font glyphs; there's colour glyphs and subpixel Antialiasing, and subpixel positioning. Commonly you're storing 3 channel alpha (or color), and 6 copies of each glyphs at different subpixel positions. You're not blitting these glyphs, you're blending them with the background. Font atlases do not fit in cache, especially at 4k. You also need to not just write the framebuffer, but also send it to the GPU. On some systems that can be done quickly, on others you're going over PCIe. And on top of all that, you have the data structures that are telling you what text to render where, which further fill the cache.

All that to say, your example of blitting a single color is very, very far away from the practical reality of rendering a GUI.