Hacker News new | ask | show | jobs
by okasaki 5 days ago
imgui reconstructs and rerenders the UI every frame. The code might be bloat free but it's probably not more efficient than a TUI or browser UI.
4 comments

A TUI from the 1980's certainly not, as framebuffer would only be updated on the required changes in most existing hardware.

Now an emulated nostalgic TUI on a system running on top of a GPU using Vulkan, Metal, DirectX to draw a terminal emulator pretending to be a 1980's computer, most likely not.

This sounds like a valid criticism until you realise that at a low level you need to redraw the UI for every frame anyway.

It's only in higher level operations that frequent redrawing becomes a problem.

Of course you don't; you only need to redraw things that have changed, when they change.

Back when computers didn't have so much spare capacity that's how most UIs worked. That's why the Win32 and X11 systems (and probably others but those are the ones I'm familiar with) give your application information about what specific rectangle of the window needs to be repainted when they ask the application to repaint something.

That's still redrawing everything, just with caching.

With the current rise in compute capacity, caching is not automatically faster than recomputation.

It might not use that much power because gpus are so fast.

Maybe rendering is easier than diffing in some cases?

> imgui reconstructs and rerenders the UI every frame

Have you got to the second paragraph?

"Unlike conventional ImGui applications, rendering is passive and will not consume resources while idle."