[Performance] Combine AsyncImageView optimizations#83
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch combines the independently reviewed changes from:
UIImage.scalein the disk cacheComponent benchmarks
PieceViewhitsCombined WatchChess benchmark
Release WatchChess, iPhone 17 Pro Max / iOS 26.5 simulators, 10 samples per variant and flow. Negative CPU/hitch changes are improvements.
CPU
FPS and hitches
FPSbelow is a main-run-loopCADisplayLinkcallback proxy over the exact UI-action window, not compositor presentation FPS.Missed-refresh rates were also neutral for tournaments (-3.62%, CI -21.79% to +14.17%) and game (+2.99%, CI -5.93% to +13.06%). Rounds trended lower (-26.69%, CI -47.25% to +4.29%).
Methodology and controls
currentEngineStrength = 1) and validated inside every app launch/reportAll earlier measurements with uncontrolled engine state or unequal cache warmness were quarantined and excluded.
Rendering and cache regression checks
The different cache bytes between variants are intentional: #79 stores image scale in a versioned envelope. Legacy raw-PNG entries become one normal miss and regenerate in the corrected format. Existing remote images may therefore re-download once; offline users can temporarily miss legacy cached images until connectivity returns.
#79 and #82 semantics
#79 and the #82 synchronous-subscriber review finding are different fixes, and both are included:
#82's
lifetime.observeEndedintentionally holds the wrapper and in-flight entry only until producer completion or cancellation. Weak-reference tests verify release after both paths, while cancellation still disposes upstream work; no retain cycle or leak was observed.Validation
swiftlint --config .swiftlint.yml --strict: 0 violations