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

Optimize Compositor by combining updates #493

Merged
merged 13 commits into from
May 12, 2022
Merged

Conversation

willmcgugan
Copy link
Collaborator

  • Deferred rendering of widget updates. When a widget update is request, Textual will wait for 50ms for further updates.
  • The compositor can now render multiple updates in a single render.

@willmcgugan willmcgugan marked this pull request as draft May 10, 2022 13:28
@@ -116,6 +136,43 @@ def __init__(self) -> None:
# The points in each line where the line bisects the left and right edges of the widget
self._cuts: list[list[int]] | None = None

@classmethod
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted from @darrenburns 's region_groups.py

@willmcgugan willmcgugan marked this pull request as ready for review May 11, 2022 13:36
@willmcgugan willmcgugan changed the title improved compositor granularity Optimize Compositor by combining updates May 11, 2022
Copy link

@olivierphi olivierphi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These geometrical and time-based batching operations are far too clever for my little brain 🧠 (especially with the quite little knowledge I have of the Textual internals at the moment), so I can only comment on things that really don't matter, like typos in comments - sorry 😬

src/textual/_compositor.py Outdated Show resolved Hide resolved
src/textual/_compositor.py Outdated Show resolved Hide resolved
src/textual/_compositor.py Show resolved Hide resolved
@willmcgugan willmcgugan merged commit 96ce420 into css May 12, 2022
@willmcgugan willmcgugan deleted the compositor-granularity branch May 12, 2022 10:41
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