You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a Textual app is suspended for some reason - typically because the device it's running on goes to sleep - then it will temporarily hang on resume from sleep and refuse to update or accept input. This is typically a minor stutter after a brief sleep; after being left overnight it can be several seconds; left for long enough it becomes minutes.
If a timer with skip enabled has fallen behind, then it busy loops until it catches up. This is fine if it's only a little behind, but rapidly becomes expensive if it's a lot behind. This busy looping behaviour happens in, for example, the "screen_update" timer which fires every frame. An app which has been suspended racks up about five million ticks a day, enough to produce noticeable lag while the busy loop catches up.
This is easy enough to fix - just calculate the next required timer fire rather than busy looping.
The text was updated successfully, but these errors were encountered:
If a Textual app is suspended for some reason - typically because the device it's running on goes to sleep - then it will temporarily hang on resume from sleep and refuse to update or accept input. This is typically a minor stutter after a brief sleep; after being left overnight it can be several seconds; left for long enough it becomes minutes.
This occurs because of the loop here:
textual/src/textual/timer.py
Lines 152 to 157 in f5be1b7
If a timer with skip enabled has fallen behind, then it busy loops until it catches up. This is fine if it's only a little behind, but rapidly becomes expensive if it's a lot behind. This busy looping behaviour happens in, for example, the
"screen_update"
timer which fires every frame. An app which has been suspended racks up about five million ticks a day, enough to produce noticeable lag while the busy loop catches up.This is easy enough to fix - just calculate the next required timer fire rather than busy looping.
The text was updated successfully, but these errors were encountered: