Skip to content

Conversation

@thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Feb 21, 2024

Description

  • Updates the layoutManager.endTransaction method to only force layout if determined to be necessary by the caller, dramatically reducing the number of times complete layout occurs.
  • Cleans up the hitTest method on TextView to just return self if the hit is in the visible rect (was taking 100's of ms to perform before).
  • Adds 350px of padding to the layout method in TextLayoutManager. This fixes a small visible bug where scrolling very fast would briefly lag behind on layout and lines would not be rendered immediately. With this change, the lag still occurs but it happens invisibly to the user.

For the last point, it was determined that the slowest part of the layout process is actually removing line fragment views from the hierarchy. Other methods were explored such as hiding views or setting their frame to 0 in place of removing them, but similar performance hits occurred.

Related Issues

  • N/S

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

@thecoolwinter thecoolwinter changed the title General Performance General Performance Improvements Feb 21, 2024
@thecoolwinter thecoolwinter merged commit 7d2412c into CodeEditApp:main Feb 21, 2024
@thecoolwinter thecoolwinter deleted the fix/scroll-layout-performance branch February 21, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants