fix: bag open 1sec spike

This commit is contained in:
Vati
2026-04-15 19:52:14 +04:00
parent 1c57cde713
commit 403eb64706
3 changed files with 29 additions and 9 deletions
+7 -5
View File
@@ -108,12 +108,14 @@ local function ScheduleDeferredUsabilityCheck()
if this.elapsed >= USABILITY_CHECK_DELAY then
this:Hide()
this.pending = false
-- Only run if bag is still open
-- Only run if bag is still open.
-- Note: we intentionally do NOT ClearCache here. GetItemProperties
-- already refuses to cache partial-tooltip scans (tooltipLooksComplete
-- guard in ItemDetection), so rescanning naturally re-hits items
-- whose first scan was incomplete while leaving good cache entries
-- intact — wiping the cache would defeat CacheWarmer and force a
-- full ~80-item tooltip burst every open.
if Guda_BagFrame and Guda_BagFrame:IsShown() then
-- Clear detection cache and re-check all items
if addon.Modules.ItemDetection and addon.Modules.ItemDetection.ClearCache then
addon.Modules.ItemDetection:ClearCache()
end
UpdateAllUsabilityTints()
end
end
+6 -2
View File
@@ -23,8 +23,12 @@ function Guda_CategorizeItem(itemData, bagID, slotID, categories, specialItems,
local itemName = itemData.name or ""
local cat = "Miscellaneous"
-- Detect consumable restore/eat/drink tag for current character only
if not isOtherChar and addon.Modules.Utils and addon.Modules.Utils.GetConsumableRestoreTag then
-- Detect consumable restore/eat/drink tag for current character only.
-- Gated on class == "Consumable": the "while eating"/"while drinking"/"use:
-- restores" patterns only appear on consumables, so scanning other items
-- just wastes a tooltip roundtrip per bag on the cold-cache path.
if not isOtherChar and itemData.class == "Consumable"
and addon.Modules.Utils and addon.Modules.Utils.GetConsumableRestoreTag then
local tag = addon.Modules.Utils:GetConsumableRestoreTag(bagID, slotID)
if tag then
itemData.restoreTag = tag