August 2nd, 2024

Ask HN: Performance regressions in SwiftUI apps on macOS Sequoia

A developer created a sorting visualization app for macOS and iPadOS, facing performance issues on macOS Sequoia. Despite reporting bugs and seeking help, they received no responses and are seeking assistance.

Ask HN: Performance regressions in SwiftUI apps on macOS Sequoia

A developer training in macOS and iPadOS has created a sorting visualization app, which is available on the App Store. The app performs well on macOS Sonoma, but after testing it on macOS Sequoia with Xcode 16 beta, the developer noticed significant performance lags attributed to changes in SwiftUI. Despite conducting nearly 50 Instruments traces to identify the issue, the developer found no clear indicators of performance problems, such as unusual GPU or CPU behavior. They have reported two bugs to Apple via Feedback Assistant but have not received any responses. Attempts to seek help on the Swift forums were unsuccessful due to privacy concerns regarding Apple-owned frameworks, and inquiries on the Apple Developer forums also went unanswered. The developer even signed up for office hours with Apple but had their appointment declined. They have provided detailed traces, videos demonstrating the performance issues, and a reproducer project in their bug reports. Feeling at a loss, the developer is reaching out for assistance, hoping to connect with Apple engineers involved with SwiftUI or Mac Catalyst, or anyone else experiencing similar performance issues. They express gratitude for any help that can be offered.

Link Icon 3 comments
By @brailsafe - 9 months
Good move, SwiftUI and MacOS performance can't tolerate any more performance degradation. The Settings app for example opens a separate process for each tab and keeps it around until you quit Settings; I'm not sure if this is why it's so slow, but it is like wading through ketchup. If you click on the first item below your profile photo and then press the down arrow to the bottom, it will open a new process for all of them.

In my experience building a similar app that I haven't launched, NavigationSplitView ended up causing a few hitches when switching or recycling views, it was distracting enough that I kind of lost momentum on it for now.

It's a bit frustrating that it's such a black box and we have to wait a full year for announcements and updates, nothing happens in the open and we're entirely dependent on their feedback system.

By @nhubbard - 9 months
Update: Apple got back to me! It turns out that my code had a silent bug: my conformance to the Equatable protocol wasn't considering the current color of the rectangles drawn on screen, and one of the performance improvements in macOS Sequoia/iPadOS 18 is that ForEach elements don't re-draw if they aren't changed.
By @dnh44 - 9 months
As part of your yearly developer membership fee, Apple offer 3 incidents of code level support. This sounds like an appropriate situation where you'd want to use the service.

https://developer.apple.com/support/technical/