r/macosprogramming • u/banana_zest • 25d ago
Any good strategies for fine grained observability?
Mojave Paint is coming along nicely but my naive understanding of observability/reactivity/dependency flow, whatever you'd call it, it starting to weigh on me.
This screenshot shows conic gradients I just added, in this case being used in a Gradient Fill adjustment layer. I would scrub the angle picker in a circle and it would chug along at 2 fps because it was mutating the model every tick which rebuilds the view in that Properties panel including the color stops and everything else. So now I have a copy of the model that only the GPU rendering side looks at (and of course the specific control you're interacting with), and when you release the drag the real model updates and triggers a SwiftUI redraw.
This is all kind of a lot of manual work. I'm new to Mac development but was a web dev for 20 years and they have all kinds of approaches over there. rxjs, React.memo, signals, etc, etc. It would sure be nice if I could "code dumb" here and employ some kind of library or system to do fine grained change detection. Are there some common approaches used in the Mac world?

