Tips for improving performance? #1441
-
I'm writing a textual app that involves frequent re-painting of much of the terminal using a custom rich renderable, and I'm running into (what appears to be) performance issues. Not sure if I'm my approach is inefficient or if this is a fundamental problem with my terminal Does anyone have any insight about efficient frequent re-painting? I'd also appreciate guidance on profiling or a link to any resources/implementation details about how textual's re-painting works. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There are many things that can impact performance. I'd need to see code to offer any concrete suggestions. Textual will generally avoid repainting more than it needs to. If you change the state multiple times, it should still only result in a single repaint. I'd start by profiling first. Try PyInstrument for a coarse profile, which should tell you where the majority of the time is being spend. |
Beta Was this translation helpful? Give feedback.
There are many things that can impact performance. I'd need to see code to offer any concrete suggestions.
Textual will generally avoid repainting more than it needs to. If you change the state multiple times, it should still only result in a single repaint.
I'd start by profiling first. Try PyInstrument for a coarse profile, which should tell you where the majority of the time is being spend.