This issue in practice doesn't cause any problem at all, nor really affects any in game experience, so take your time when you want to take a look :)
I notice that GoGoMount has a relatively high CPU usage in CPU profiling. It has a slight delay when one clicks the GoGo buttons (but doesnt affect gameplay because it's usually forgiving when we want to use a mount).
When I trace down I find that GoGo_FilterMountsOut(PlayerMounts, FilterID) has the most CPU time, I think it's due to the repeatedly table creation and the iteratively table insertion inside. While you return the newly filtered table, according to the calls of this function in the code, the old PlayerMounts table is basically thrown away (to the garbage collectioni), which is also a minor performance decrease.
The GoGo_FilterMountsIn has similar issue though it takes less time.
I think a change that makes the table update in-place will do, but that may mean you need to change the table structure from sequential solid array to a sparse table, and also change the later "random" part. I can imagine that it's annoying here and there and not very productive lol So again, you see if it's worth doing and take your time :)
P.S.: Not being pushing, I reckon it could reduce 80% of CPU time. But what's the point of speeding up a not-slow-at-all addon... err... (pondering) ... It's 400% COOLER!! :D
|Everdreamer||Nov 02, 2012 at 09:14 UTC||Create|
- 1 comment