Repository navigation
Conversation
- ImageManager and IndicatorStatus get a stored ObservableObjectPublisher - the synthesized getter scans a global weak table on every send(), O(N) per image event
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughImageManager and IndicatorStatus now declare explicit ChangesObservableObject Publishers
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The change gives both observable objects stable publishers for their manual notifications; no merge-blocking regression is supported. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The Unit Test failures are unrelated to this change: the only failing test is |
Problem
ImageManagerandIndicatorStatusrely on the synthesizedobjectWillChange.The synthesized getter resolves the publisher through a global lookup on every
access, so each
send()during image loading pays that cost. In a screen withmany
WebImageviews updating at once this shows up as main-thread timedominated by the publisher lookup.
Fix
Declare a stored
public let objectWillChange = ObservableObjectPublisher()inboth classes. Behaviour is unchanged: same publisher type, same send sites.
Impact
In our app (a scrolling list of
WebImageviews plus a sheet with artwork),main-thread time for the same interaction dropped from ~1110 ms to ~427 ms.
Independent of #364: that PR changes where
send()is called, this one onlychanges how the publisher is stored.
Summary by CodeRabbit