Put a throtle on the UpdateBars function, reducing CPU usage to about 20%-40% compared to before, with no loss of threat updates (more savings when in a larger raid).
This commit is contained in:
@@ -1313,8 +1313,19 @@ function Omen:FindThreatMob()
|
||||
self.unitID = nil
|
||||
end
|
||||
|
||||
local queried = false
|
||||
-- Frame for throtling updates
|
||||
local OmenUpdateBarsThrotleFrame = CreateFrame("Frame")
|
||||
OmenUpdateBarsThrotleFrame:Hide()
|
||||
OmenUpdateBarsThrotleFrame:SetScript("OnUpdate", function(self, elapsed)
|
||||
self:Hide()
|
||||
Omen:UpdateBarsReal()
|
||||
end)
|
||||
function Omen:UpdateBars()
|
||||
OmenUpdateBarsThrotleFrame:Show()
|
||||
end
|
||||
|
||||
local queried = false
|
||||
function Omen:UpdateBarsReal()
|
||||
if db.Autocollapse and db.CollapseHide then
|
||||
-- Update the visibility because it could have been hidden on 0 bars
|
||||
self.BarList.barsShown = 1 -- Dummy value
|
||||
@@ -1325,8 +1336,6 @@ function Omen:UpdateBars()
|
||||
return
|
||||
end
|
||||
|
||||
-- TODO: Put a update throtle on this function
|
||||
|
||||
local myGUID = UnitGUID("player")
|
||||
local dbBar = db.Bar
|
||||
local mob, mobGUID, mobTargetGUID
|
||||
|
||||
Reference in New Issue
Block a user