#737 closed enhancement (no change required)
sInfo can be crazy expensive...in combination with 'smart select' widget
Reported by: | Floris | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | BAR | Version: | |
Keywords: | Cc: |
Description
But its easy fisxable:
fix: only update info on mouseup
Change History (4)
comment:1 by , 8 years ago
Resolution: | → no change required |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
Yes 'smart select' could/will be optimized by not updating whenever there is nothing added/removed to the selection.
But... then still... sInfo is very costy whenever there are (rapid) changes.
Therefore you shouldnt blame it all on the 'smart select' widget being at fault here, although it mainly is.
(and 'loop select' widget is irrelevant)
comment:3 by , 8 years ago
In matter of fact... I just have prevented 'smart select' from updating when there isnt a change.
sInfo is still over 10x more expensive than fancy unit selections when draggign a selection.
comment:4 by , 8 years ago
"But... then still... sInfo is very costy whenever there are (rapid) changes."
True - but there are not rapid changes (in your case a widget causes them). There is no realistic prospect (or need) to reduce the slice of time sMenu takes to reconfigure itself after CommandsChanged. I suggest you implement you original idea of only causing a layout update on MouseRelease into your smart select widget.
"sInfo is still over 10x more expensive than fancy unit selections when draggign a selection"
I presume you meant sMenu, since sInfo costs next to nothing.
Of course (even if this were true - you provide no means to test) this is in contrast to the somewhat more important (at rough guess) 99% of drawframes where the selection does not change and FancySelectedUnits? takes up (after quick calculation) 50-200x as much time as sMenu.
So this comparison is apples<->oranges - if you want something for the future to compare FSU with then healthbars is appropriate.
"(and 'loop select' widget is irrelevant)"
If you are having difficulty seeing the relevence, you can ask.
The point is that loop select allows to select large numbers of units in any shape one chooses, without (as you suggested smart select should do in the original ticket) causing any layout updates until MouseRelease.
forcing constant layout updates -> smart select is at fault here
note that bar uses loop select
(also, duplicate of #649)