Skip to content
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

Performance improvements during layout calculation #122

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

elfredpagan
Copy link
Contributor

Details

Both invalidateSectionMaxYsCacheForSectionIndices and invalidateEntireSectionMaxYsCache do linear passes. These are called on each section header, section footer and background. Leading to a lot of work being done with long lists.

This PR short circuits the work if we try to remove header, footers and backgrounds that don't exist.

A better option would be to run the calls above once per update vs per update item. That would require a bit more rework though.

Related Issue

Motivation and Context

I was working with long lists and was getting a significant amount of hangs.
This was before the change:

This was after:

How Has This Been Tested

Tested in the airbnb app.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Both `invalidateSectionMaxYsCacheForSectionIndices` and `invalidateEntireSectionMaxYsCache` do linear passes. These are called on each section header, section footer and background. Leading to a lot of work being done with long lists.

This PR short circuits the work if we try to remove header, footers and backgrounds that don't exist.

A better option would be to run the calls above once per update vs per update item. That would require a bit more rework though.
@elfredpagan
Copy link
Contributor Author

applied the changes.

@bryankeller bryankeller added the enhancement New feature or request label Mar 4, 2024
@bryankeller bryankeller merged commit 2d0d4f9 into airbnb:master Mar 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants