Replies: 2 comments 6 replies
-
Thanks for the detailed analysis. Interesting that Can you share your project? We might be able to offer more suggestions. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
App Summary
pyserial-asyncio
Label
widgets, each usingquery_one
method withid
selector andexpected_types
.Datatable
Label
widgets and aInput
widget to change the value for the parameterIssue
The app was not really responsive while and after creating around 800 widgets for the parameters.
Profiling
I ran pyInstruments as Will suggested and it turns out
query_one
method was the bottleneck.Troubleshotting
Message
from workers and handled updates within the message receiver. (Small improvement)query_one
from the direct parent of the widget, instead ofApp
, improved performance(60% of total app runtime -> 40%)query_one
and caching label widgets as variables for direct access greatly improved performance(60% -> 5%). While this is not recommended, it may be worth using in hot loops with widgets that are not being removed and mounted again.mount_all
instead ofmount
withfor
loop greatly improved performance. Also, removing widgets usingremove_children("*")
greatly improved performance as well.Remaining Issue
VertialScroll
container. This lags once in a while during scrolling.Beta Was this translation helpful? Give feedback.
All reactions