Daily iOS
SwiftUI

SwiftUI performance diagnosis

On a dashboard screen built in SwiftUI, the whole screen stutters on every character typed into a text field. What's your hypothesis for what's going on?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The hypothesis is that the input state lives in a large upstream view (or a single ObservableObject), so every keystroke re-evaluates the upstream body and all of its children, compounded by heavy computation inside body and unstable identity.

Share a question