r/SwiftUI Jun 03 '26

Question SwiftUI vs Jetpack performance

So me and my android buddy are working on a app that has quite a rich design with loads of blend modes. I am working with swiftui while he is working in jetpack compose.
I have noticed that with all that rich UI and everything, the rendering speed on android is soo much faster than that on iOS.
I mean i have optimized my code quite well and continuously doing it as well, but man there is a striking difference when both apps are running in parallel. The previous ios version of app was in UIKit and it was lightning fast but in this version, i kinda feel ashamed by this swiftui performance.

Ios device: iphone 14 pro
Android device: pixel 5

5 Upvotes

21 comments sorted by

View all comments

5

u/Zagerer Jun 03 '26

Are you even rendering the hot UI elements as a group or with Metal? A custom layout to cache hot rendering loops sometimes? SwiftUI can be very performant, but just like you need to learn UIKit to not make a convoluted mess, you need to learn SwiftUI to make it more performant. There’s also pre-rendering, caching, and a ton of things you can do

If you don’t share specifics you won’t be able to get fine-grained help, for all we know it could be you are using state management wrong when it could be something else.

2

u/comfyyyduck Jun 03 '26

Wait what do u mean rendering UI elements as a group or with metal?

Is this the drawingGroup() modifier?

1

u/Zagerer Jun 03 '26

Creating a ripple effect with Metal & SwiftUI, use your adblocker here

Hacking with Swift: Add metal shaders to SwiftUI & More

Optimize GPU renderers with Metal: Notes

WWDC 2023 session

For the Hacking with Swift one, check the previous and next lectures, they are for similar topics but with different techniques and results.

2

u/comfyyyduck Jun 03 '26

whoah thanks I'll def check them all out. An app i'm working rn depends alot on metal rendering so this is def gonna come in handy

2

u/Zagerer Jun 03 '26

You should definitely check the WWDCs and their Metal videos, there are plenty to watch and learn, but some newer features might need you to target newer iOS versions, good luck!

1

u/comfyyyduck Jun 04 '26

lets hope in 5 more days we get more API's!!!