SwiftUI Laggy on a Real Device

I have recently started Beta Testing my SwiftUI App on my iPhone 6s, previously I was testing it on the iPhone 12 Simulator. While Testing on the Real Device I encountered issues like:
  1. CPU going past 98%

  2. Really Laggy ScrollView

  3. Tab Bar Freezes Randomly

Since My app is going to go in Production State in a few days, Since this is my first iOS App as well, I am not too sure if these issues are because of SwiftUI, my Phone or what, I have asked Apple Support but, haven't received a response so far.
My App Stats:
Lines of Code: ~1,500
CPU Usage on Simulator: Max. 10%
Bundle Size: 2MB
RAM Max. on Simulator: 32.3mb
Answered by NavTheNugget in 688316022

Almost 8 months later, and here are my thoughts on the issue, 8 months ago, SwiftUI was pretty new and had a lot of hidden bugs, especially in testing.

The problem I think I had was that when testing in debug mode, the system would perform more calculations and since I was rendering a lot of images in LazyVStack, which is good for lazy-loading but throttles when you feed in too much stuff, after scrolling through 25 images, the LazyVStack started throttling which caused the app to freeze.

This is my own thinking, Apple never responded back, even though I used one of my incidents, and even sent all the copyrighted code. My solution to this problem was: Just migrate to UIKit, SwiftUI is too young for complex applications with a lot of images and network requests, it just can't handle all the pressure.

Hopefully this helps someone.

Accepted Answer

Almost 8 months later, and here are my thoughts on the issue, 8 months ago, SwiftUI was pretty new and had a lot of hidden bugs, especially in testing.

The problem I think I had was that when testing in debug mode, the system would perform more calculations and since I was rendering a lot of images in LazyVStack, which is good for lazy-loading but throttles when you feed in too much stuff, after scrolling through 25 images, the LazyVStack started throttling which caused the app to freeze.

This is my own thinking, Apple never responded back, even though I used one of my incidents, and even sent all the copyrighted code. My solution to this problem was: Just migrate to UIKit, SwiftUI is too young for complex applications with a lot of images and network requests, it just can't handle all the pressure.

Hopefully this helps someone.

Has it been fixed now?

SwiftUI Laggy on a Real Device
 
 
Q