fix members of a multibar always rendering#630
Conversation
5f28ab1 to
53b4628
Compare
|
This seems like a pretty roundabout way of doing it. Could we instead keep the |
53b4628 to
90df9b6
Compare
|
Think I get what you mean, I'll try something 👍 |
|
Actually i'm not so sure I get it 😞 Do you mean removing the "delayed" logic altogether? If I do that, a low frequency bar might never redraw if a high frequency bar gets all the allowances 😕 |
|
In my mind the ideal way of doing this is that we should only draw all of the multistate members together into a single drawable, relying on the It might be tricky to make this work out, though. |
Hi!
I noticed a rather inconvenient performance issue with
MultiBar, contrary to regular progress bar no rate limiter will prevent computing the string that will displayed for a given memberProgressBar. The cost of this "hidden rendering" can quickly add up if unicode+ANSI decoding features are enabled.My implementation relies on actually rejecting calls to
DrawTarget::drawablefor multi-bar targets but marking the member as "delayed" for later redraw. When a call for drawable is actually accepted, all delayed member or first redrawn.Here is an example flamegraph from the application I'm building, using the main branch :
A recurring call to
set_lengthtakes 30% of the running time in the example above. With my patch it is down to <4% :