Can someone explain to me the benefits of swiftUI/react’s approach over immediate mode graphics? The diffing algo & layer memory seem like overhead when you could render directly to the screen. (JS/DOM Can’t, so there it makes sense)
Conversation
In the case where most of the UI does not change each frame, as is the case in typical application UI, the overhead of diffing is generally lower than typical immediate mode overhead of repainting/emitting-draw-calls.
But if any visible part of the UI changes, repaint/draw-call still happens via CA anyway, right? So where’s the win?
1
1
I’m assuming the immediate mode approach would only clear/redraw framebuffer when needed, and not every display refresh.
1
1
Show replies
One of the big speed wins I found in my home-grown “baby react” model is that I don’t have to replicate expensive calculations if the inputs didn’t change. Like, re-calculating the path of a dashed line was somewhat expensive, but I can skip it if the line is exactly the same.
1
1
Just checked out your blog (great writing!) - didn’t see anything about your baby react. Do you talk about that anywhere else? Is the source public?
1
Show replies


