High CPU usage when opening bags with BagSync addon
Defmaster opened this issue ยท 3 comments
Addon Version
v1.9.48
World of Warcraft Version
Retail
Describe the bug
COPY FROM BAGSYNC ISSUE: Xruptor/BagSync#207
Hi,
lately i noticed that whenever i open my bags, i have a 1-2s freeze.
As base bag addon i am using AdiBags.
Before opening bags:
Memory: 7.63 Mb
CPU: 2290 ms
After opening bags;
Memory: 10.04 Mb
CPU: 2448 ms
Those numbers are with pretty empty inventory. The more items i got in inventory the higher the CPU usage (got to like 300ms for 1 bag opening on char that has ~80 Slots filled)
So just opening bags 1 time, causes Bagsync to use up 158 ms. (Using Lib version, but having Ace3 as seperat Library, which also takes some CPU whenever opening the bags)
When i disable BagSync the freeze goes away.
When disabling AdiBags and using default WoW combined bag (or ElvUI Bags), BagSync does not use CPU when opening bags (only when hovering over item and creating tooltip)
My guess would be, that AdiBags using tooltips scan to generate some filters and everytime it does, BagSync is triggered too.
I don't know if it can be fixed or just how AdiBags works.
Steps to reproduce
- Have BagSync addon
- (have some stored data)
- Open Bags
Verification
- I have disabled all other addons and made sure this bug is triggered only with AdiBags enabled
Did some more testing and noticed i had still an addon active.
AdiBags_Hearthstone ( AdiBags Hearthstones )
But when testing with others like: AdiBags - Korthian Relics it happens too.
So AdiBags without any additional AdiBags extentions seems fine. So it's the handling from those additional ones.
Example from the Korthian Relics one: (i don't know if its the expected way to handle AdiBags extension)
function itemFilter:Filter(slotData)
if self.items[tonumber(slotData.itemId)] then
return L["Korthian Items"]
end
tooltip = tooltip or tooltipInit()
tooltip:SetOwner(UIParent, "ANCHOR_NONE")
tooltip:ClearLines()
if slotData.bag == BANK_CONTAINER then
tooltip:SetInventoryItem("player", BankButtonIDToInvSlotID(slotData.slot, nil))
else
GameTooltip:SetBagItem(slotData.bag, slotData.slot)
end
tooltip:Hide()
end
Yes, tooltip scanning is very system resource expensive which is why its use has been avoided for the most part. Thankfully, much of it is no longer necessary due to recent API improvements. However, the authors of these third-party filter addons need to implement the necessary changes, we can't do it for them.
As @Talyrius mentioned, please reach out to the plugin authors for a fix.
Thanks!