3 ms·
The post didn't go into much detail as to why it seems to be so slow. Is SwiftUI recreating an entire UI's worth of components when a state update happens?
by TazeTSchnitzel 4y ago
The post didn't go into much detail as to why it seems to be so slow. Is SwiftUI recreating an entire UI's worth of components when a state update happens?
- bsaul 4y agoTo me that’s the red flag. That an experienced game developer wasn’t able to properly troubleshoot down to the correct level, but ended up facing a black box and gave up.
- bowsamic 4y agoWell that's supposed to be the point of SwiftUI. You write out your declarative structure, let the library worry about how to make it fast, and move on with your day. They literally introduced it that way. Obviously that is very detached from reality
- ohgodplsno 4y agoI am not developing on Apple platforms, but just like any reactive UI framework, i am almost certain the documentation of SwiftUI starts with a massive red flag that says "make your updates granular and don't repost a whole ass struct on every frame" at the very beginning which is exactly what the author seems to be doing. If all you want is a declarative UI, just dump in ImGui and be done with it.
- yakubin 4y agoImGui doesn't give you native OS widgets.
- saagarjha 4y agoGame developers typically redraw the entire world on each frame. This is not how UI frameworks are intended to be used, even though SwiftUI presents an interface that kind of looks like that. I'm not blaming the author for not understanding this, but I think this distinction is very important to make when working with SwiftUI.
- deleted 4y ago[deleted]