This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 124
Avoid unnecessary recomputing of layouts #14
Comments
I found this issue interesting and I started looking into
|
yml
added a commit
to yml/tui-go
that referenced
this issue
May 24, 2017
The cpuprofile of `example/http` shows that when resizing the app with some large blob of text in Labels the function `label.SizeHint()` is the bottle neck. The app becomes slow.
Looking over the change above - it's a little surprising (to me) that the cache isn't also reset on Resize() of a label, since the SizeHint is dependent on the label's size (in the word-wrap case). But I'm also not coming up with a test case where it doesn't work... |
This was referenced Dec 22, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently,
SizeHint
s are calculated on every event which is expensive and makes the UI slow when you for example have labels with a lot of text.Try visiting a web page in the
http
example. When the response finishes loading, typing becomes really slow. Profiling shows that a lot of time is spent inLabel.SizeHint
. A likely solution is to add dirty flags to layouts and widgets to indicate whether the call toResize
can be avoided.The text was updated successfully, but these errors were encountered: