-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: Make CameraPositionState and MarkerState stable #254
perf: Make CameraPositionState and MarkerState stable #254
Conversation
## [2.8.1](v2.8.0...v2.8.1) (2023-01-19) ### Performance Improvements * Make CameraPositionState and MarkerState stable ([#254](#254)) ([52bd69e](52bd69e))
🎉 This PR is included in version 2.8.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Nervous about seeing additional state added to MarkerState: an app may have quite a lot of Marker/MarkerState objects. Were time/space performance impacts considered? |
@bubenheimer No, those weren't considered. A benchmark would be useful. I made the judgment call that stability of a State class is generally expected, and so ours should fit the pattern. |
The Marker-related change looks like a red flag to me. As you may be aware, I believe that |
I'm gonna take some time to digest your thoughts in #149. Thanks very much for the detailed explanations. The MarkerState changes were made with defensive correctness in mind (I'm not positive about enumerating all cases that can modify those properties, now and in the future). I'm inclined to try benchmarking some scenarios. |
CameraPositionState
has a few unstable properties. Rather than verify all usages of these are safe for stability, I'm opting to back them with mutable states, so the compiler can mark the class stable for us.MarkerState
'sinternal var: Marker?
property was causing the class to be marked unstable.While I think it can safely be marked
@Stable
as-is, I'd rather have the compiler infer that. I feel better backing it with an actual state value, that way if we later do an actual non-imperative state read it won't break stuff.Verified stability via compiler report.
Fixes #232 🦕