Last week, while debugging a SwiftUI performance issue, I was running instruments and found that my profiles were plagued with noise.

Godot while idling was using so much CPU time that it was skipping entire frames while rendering.

I set out to fix those, 0.5% here, 0.5 there, and the Godot Editor (and Xogot) no longer skip frames.

People had been complaining that Godot would burn your battery in an hour if you left it idling, it no longer does.

Details:

https://github.com/godotengine/godot/issues/116845

As a sidebar, when I started porting Xogot to Mac, my first reaction was "SwiftUI is just not up to the task, it is too slow".

I decide to give Instruments a shot with the new SwiftUI instrument, and was able to track down the problems - it took a while (and Claude scanning my traces), but Xogot powered by the same SwiftUI code from iPad on AppKit is smooth as butter.

It was just not as noticeable on iPad, as the touch interface would distract from the slowdowns.

@Migueldeicaza a few years back, I ended up with the same conclusion while working on CiderKit. And I’m still using AppKit for that reason.

https://chsxf.dev/2022/08/28/5-tup-why-i-quit-using-swiftui.html

Why I Quit Using SwiftUI

SwiftUI is currently the new trend in the Apple development world. And I wanted to give it a try. I did. However, in this post, I explain why I went back to AppKit for The Untitled Project’s authoring tools.

chsxf.dev
@chsxf oh, but we came to different conclusions - with the new profiler I was able to fix all the issues and stay in SwiftUI
@Migueldeicaza on that front you’re right. At the time, I wasn’t able to exactly pin point where the problem was, and it was simpler for me to stay with AppKit and actually do stuff that worked. But I’ve been considering revisiting this part for some time so maybe this is it.
@chsxf makes sense. Also the new profiler really takes a lot of the guesswork out of it. You can clearly see and find out what is wrong, and before it took a lot of trial and error and too much knowledge of sausage making.