3 ms·
See this answer: https://swiftui-lab.com/digital-lounges-2022/#data-15 https://swiftui-lab.com/digital-lounges-2022/#data-15 > Surely on a modern computer you
by rudedogg 4y ago
See this answer: https://swiftui-lab.com/digital-lounges-2022/#data-15 https://swiftui-lab.com/digital-lounges-2022/#data-15
> Surely on a modern computer you can redraw a couple of text fields at 30fps?
Yeah this is the tricky thing, with how (I'm guessing) the code looks, you would think it's only updating the text fields. But in reality it's probably re-rendering the entire hierarchy using the @EnvironmentObject. So the SceneKit view gets setup and rendered every update of the Slider.
------------------
I have real-time color pickers for changing all windows in my app. Same with font sizes. It's possible to make it work, you just have to modify your design (which is unfortunate).
- jules 4y agoAh I see, so each of the values that are shown in the inspector should become its own observable object? That sounds reasonable. > But in reality it's probably re-rendering the entire hierarchy using the @EnvironmentObject. So the SceneKit view gets setup and rendered every update of the Slider. I get that this is slower than only updating the single value, but what I don't understand is why even this is so slow? Browsers can render the right hand side of this inspector UI (https://chsxf.dev/assets/posts/5/map-editor-with-inspector.png https://chsxf.dev/assets/posts/5/map-editor-with-inspector.p...) at reasonable speed even if you rebuild the entire DOM for the fields in the inspector. I mean, it's one checkbox, one slider, and 7 text boxes and a bunch of labels. What is taking so much time here?