SwiftUI List performance is slow on macOS

SwiftUI performance is much slower on macOS than on iOS. macOS running SwiftUI is even slower than the iOS simulator.

As a simple example, create a List with a few hundred rows (anything over 100 gets pretty bad). macOS scrolling gets unacceptably slow. This is made even worse if the rows have interactive items like Slider or TextField (think a medium complexity inspector). Take the same exact code and Build and Run on iOS and it feels much smoother.

Is this an issue with the Window Server? I keep hearing from Apple that SwiftUI is the future of UI for Apple Platforms. And I believe you. But we’ve been waiting a year for performance improvements so that we can seriously consider SwiftUI in our new products and they haven’t come to macOS. Can we expect to see a fix? If SwiftUI isn’t the right framework for multi-platform pro applications (image rendering/editing) then what is?

Note that using Equatable helps stop the entire view from recomputing and I've also tried using the new Lazy* Views which do help a bit but I'm not seeing anything close to iOS performance on macOS.


Replies

Thanks for the bug report! We are continuing to investigate and improve the performance. Using a ScrollView with a LazyVStack will help eliminate some of the overhead of List if you aren't using the features it specifically provides.
Yeah I also can confirm my SwiftUI Cross-platform Application is running much slower than in the iOS Simulator, seems like a Memory leak since the app is running on iOS using only 20mb of ram but on mac it keeps climbing to like 1 GB of ram, using ScrollView with a LazyVStack that Provides sections in grid format using the new LazyVGrid

I've also seen a leak as well when hiding and displaying controls in list so this may be related.