[Second review] SE-0395: Observability

@Philippe_Hausler Are you and the team aware of any performance issues in the current implementation?

After using things for a few weeks and migrating some model code from Combine and ObservableObject to @Observable I decided to benchmark both approaches and was surprised to see the @Observable version was about 10x slower, and spent 10% of its time in access(_ keyPath:) via _swift_getKeyPath(pattern:arguments:).

I know @Joe_Groff has mentioned in the past that there are still performance wins to be made with key paths:

I'm curious if this performance is to be expected long term, if improvements are in the pipeline, or if it'd be helpful to dive deeper into the problem.

16 Likes