Bk/performance optimizations#158
Merged
Merged
Conversation
c479981 to
90f58eb
Compare
3553fc0 to
2a4d1f5
Compare
a314211 to
311acab
Compare
brynbodayle
reviewed
Jun 8, 2026
brynbodayle
reviewed
Jun 8, 2026
brynbodayle
requested changes
Jun 8, 2026
311acab to
34e3b90
Compare
Contributor
Author
|
Fixed, thanks @brynbodayle ! |
brynbodayle
approved these changes
Jun 8, 2026
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.
Details
This is the first of three PRs to optimize MagazineLayout. I did extensive profiling, and found several hot spots.
For a collection view with 100,000 items in it, after this wave of optimizations, the time in
preparehas been greatly reduced.prepareon first load: 60ms -> 4.5ms (13x reduction)prepareafter invalidating all delegate layout values: 58ms -> 5ms (11x reduction)prepareafter rotating the device: 58ms -> 8μs (725x reduction lol)The changes in this PR don't get us all the way to those numbers, but after all three are merged, we'll get the full benefits.
These are the optimizations:
modelStateI'd suggest reviewing commit-by-commit - that should make it more clear what changes are related to certain optimizations.
How Has This Been Tested
Tested in demo app and Airbnb app. Additionally, all unit tests pass.
Types of changes