Poor startup time / hitching on M1 MacBook Air #12
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On my M1 MacBook Air, my whole computer hitches and freezes when Orca starts up. Even audio freaks out. The app also takes several seconds to initialize in total.
It's a 2020 M1 MacBook Air with macOS 13.3.1 (Ventura).
Here's a spall profile of it starting up. Unfortunately I lack the knowledge to really pinpoint the issue. https://cdn.discordapp.com/attachments/1040279196351614987/1125030418723373176/profile.spall
Could you step in a debugger through the beginning or
main()
andorca_runloop()
and narrow down when the freeze happens?The hitches are occurring in this section:
It's not clear to me that any particular call is the source of the hitches on its own. When I single-step, I don't get any hitches but some calls are sporadically slower. When I skip over the whole loop, it almost always hitches. When I skip from block to block, I sometimes get hitches and sometimes don't...
It feels like the faster I run these, the more likely it is to hitch.
yeah, so the reason behind this is that the first time you ask for a metal drawable, it seems to take some time for the system to initialize it, and then metal drawables get recycled and reused (taking much less time).
So I had hitches the first time the debug overlay was opened, and I figured it would be better to just initialize everything at startup and run smoothly afterwards. Obviously this seems to have a way worse effect on your end... what's really weird is that it should maybe stall the process for a bit, but I don't see why it would freeze your whole system?
I don't know of a good way to avoid the first few stalls when asking for drawables though, I'll have to find more info on this.
The hitching is now gone on my end. However, there is still maybe a 600ms delay between the window opening and the app being interactive. This is no longer a deal-breaker but it would be good to cut this down somehow.
This is pretty good for me now. I'm just gonna close this issue; we can pursue startup performance in more detail later.