Bufftrigger2: performance issue with unit=group and large list of spellids
mrbuds opened this issue ยท 4 comments
Describe the bug
While fighting outdoor weekly boss in a raid (with more people coming in as we fight) i noticed low fps and made a profile, which show a high cpu usage from 1 BT2 trigger with unit=group
Profiling:
WeakAuras EXPERIMENz Profiling Data:
Total time: 80497.02ms
Time inside WA: 14644.96ms
% Time spent inside WA: 18.19
Systems:
bufftrigger2 10866.99ms, 74.20%
generictrigger UNIT_POWER_FREQUENT 2281.97ms, 15.58%
generictrigger COMBAT_LOG_EVENT_UNFILTERED 452.02ms, 3.09%
text 374.49ms, 2.56%
generictrigger COMBAT_LOG_EVENT_UNFILTERED_CUSTOM 368.31ms, 2.51%
generictrigger cd tracking 112.60ms, 0.77%
load 94.54ms, 0.65%
generictrigger 84.69ms, 0.58%
generictrigger BAG_UPDATE_COOLDOWN 72.58ms, 0.50%
generictrigger UNIT_SPELLCAST_SUCCEEDED 65.07ms, 0.44%
bufftrigger2 - multi 59.25ms, 0.40%
generictrigger FRAME_UPDATE 56.45ms, 0.39%
custom text - every frame update 29.38ms, 0.20%
generictrigger UNIT_TARGET 19.01ms, 0.13%
generictrigger UNIT_SPELLCAST_START 18.93ms, 0.13%
bufftrigger 16.29ms, 0.11%
generictrigger UNIT_SPELLCAST_STOP 14.73ms, 0.10%
animations 7.83ms, 0.05%
generictrigger SPELL_COOLDOWN_CHANGED 4.69ms, 0.03%
generictrigger UNIT_DISPLAYPOWER 2.96ms, 0.02%
dynamicgroup 2.43ms, 0.02%
generictrigger GROUP_ROSTER_UPDATE 2.09ms, 0.01%
generictrigger UNIT_SPELLCAST_CHANNEL_START 1.63ms, 0.01%
generictrigger UNIT_SPELLCAST_CHANNEL_STOP 1.57ms, 0.01%
generictrigger UNIT_SPELLCAST_FAILED 1.53ms, 0.01%
generictrigger UNIT_SPELLCAST_FAILED_QUIET 1.40ms, 0.01%
generictrigger UNIT_SPELLCAST_INTERRUPTED 1.12ms, 0.01%
generictrigger NAME_PLATE_UNIT_REMOVED 1.11ms, 0.01%
generictrigger NAME_PLATE_UNIT_ADDED 0.72ms, 0.00%
generictrigger PLAYER_TOTEM_UPDATE 0.67ms, 0.00%
generictrigger UPDATE_SHAPESHIFT_FORM 0.45ms, 0.00%
generictrigger UNIT_SPELLCAST_CHANNEL_UPDATE 0.29ms, 0.00%
generictrigger PLAYER_REGEN_DISABLED 0.28ms, 0.00%
sound 0.16ms, 0.00%
generictrigger PLAYER_REGEN_ENABLED 0.08ms, 0.00%
generictrigger GCD_END 0.06ms, 0.00%
generictrigger GCD_START 0.06ms, 0.00%
generictrigger GCD_UPDATE 0.04ms, 0.00%
generictrigger PLAYER_TARGET_CHANGED 0.04ms, 0.00%
generictrigger GCD_CHANGE 0.01ms, 0.00%
generictrigger SPELL_COOLDOWN_READY 0.00ms, 0.00%
generictrigger SPELL_CHARGES_CHANGED 0.00ms, 0.00%
Auras:
Total time attributed to auras:
Cooldowns on RaidFrame++ 10129.93ms, 78.91%
Raids Cooldowns used 320.39ms, 2.50%
CFlair3 2 214.52ms, 1.67%
Combo1 2 171.53ms, 1.34%
Combo2 2 169.36ms, 1.32%
CFlair1 2 167.17ms, 1.30%
Combo4 2 166.74ms, 1.30%
CFlair5 2 166.23ms, 1.29%
CFlair4 2 163.97ms, 1.28%
Combo Flair 3 163.48ms, 1.27%
Combo Flair 2 2 161.56ms, 1.26%
CFlair2 2 161.43ms, 1.26%
Combo5 2 161.26ms, 1.26%
Combo3 2 161.24ms, 1.26%
Target CastBar 59.82ms, 0.47%
Give Innervate 55.01ms, 0.43%
Targeted Spells 51.81ms, 0.40%
Efflo duration 33.66ms, 0.26%
fail dispel/decurse 22.11ms, 0.17%
Swiftmend 18.87ms, 0.15%
Wild Growth 13.96ms, 0.11%
Winter's kiss count 13.51ms, 0.11%
Ask Innervate 12.33ms, 0.10%
Clearcasting 10.29ms, 0.08%
Anchor weed count 9.45ms, 0.07%
Star moss count 9.38ms, 0.07%
Siren's polen count 9.38ms, 0.07%
Akunda's bite count 9.26ms, 0.07%
Riverbud count 9.22ms, 0.07%
Sea stalk count 9.03ms, 0.07%
Lifebloom 1.88ms, 0.01%
middle bar cds mid 1.70ms, 0.01%
combat in 1.60ms, 0.01%
combat out 1.16ms, 0.01%
Lifebloom 2 1.13ms, 0.01%
Raid cooldowns 0.72ms, 0.01%
Wild Charge 0.37ms, 0.00%
Efflorescence 0.33ms, 0.00%
Typhoon 0.31ms, 0.00%
Barkskin 2 0.30ms, 0.00%
Nature's Grasp 0.28ms, 0.00%
innerv 0.28ms, 0.00%
Tranq 0.27ms, 0.00%
Ursol's Vortex 0.27ms, 0.00%
Ironbark 0.26ms, 0.00%
Cenarion Ward 0.25ms, 0.00%
EmptyH2 2 0.05ms, 0.00%
Empty2 2 0.03ms, 0.00%
CBack3 2 0.03ms, 0.00%
EmptyH4 2 0.02ms, 0.00%
CBack5 2 0.02ms, 0.00%
EmptyH5 2 0.02ms, 0.00%
Empty3 2 0.02ms, 0.00%
CBack2 2 0.02ms, 0.00%
Empty5 2 0.02ms, 0.00%
CBack4 2 0.02ms, 0.00%
Empty1 2 0.02ms, 0.00%
EmptyH3 2 0.02ms, 0.00%
CBack1 2 0.02ms, 0.00%
Empty4 2 0.02ms, 0.00%
EmptyH1 2 0.02ms, 0.00%
Aura:
!fVZAZTnos(B5Yvtn2xSu4lrrLB36k)qoXzCK9AQmEM1LveKiKewtrQJKsYA270V9R7gKueKWoEQ9dx5eNMKa9l0DJUb6mYC0Wr(IrdCCTT8Cg5NoY)c(Mr(lh5hG)b(Ag)5mRBJfrzJ8pV)GH9Vt(oZlJJY8f)bF0atRr(tJJddI3gne(u)i2KqEWOjakePRcz7W3oYF)4r(7Uz2SuE2ObgJ8zrtxeNud3Rtch5VilBv6h)Wh2YMh3we)HpfgV9MOl4lzrbV)9FaOhBAMiokf5W0mwsgcmDDAwmW6azJ)E(dtgb4EMisKUO6qyRtyFNhTP93wfWY4NhghXpQ8LagZ4TxhjYoz)4Y3MWNdK84Qy)me7aYviFy8uw4(XFINDzc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ytx0dbBGbauAU2ZeXnjN49zdEogYvEl0lI8rSq7lplIzDq7hpPpInovpYPe78kagPj1(CamzYInPmatlOyl8cWs1Rl6z4HKLABrWlfil1bDaijPyhnaWOKsTicaJKL66daMCtaNDaePk1AcamUMsD4ga3Lusgix2dPkDr6am5BID1tE0wz3kGpGIl1Ut4d5ugym4bPsUd6AaRW4WifKPrhA90YIIU4MhvIMck0E5bvmi6JDinDOc4)Nz8LvUxuS2N5SqSeamMDkvXUF66j0h9xpBM45r(F)8t9h(D)HNE3WdF82eo9r)B7F910PeGhRAogWiSfiedVA511XIybii8nuRnaLO4)x(Rf7kHtqMGr)NztZ8LytMxgE6vYdc4Z9V(2l)21sr5qC(S8kW)hu5YBq0fTRS(u5WUoEUyALkQXdRS8CKFaVHnQixgHG85814aEEbtRXZR5VXwU6mRN(JF)CE(wqfh0Wzy2olXJ(X3STrBqIXBa9(egONVVecXX551wLNwYDmraDaQV)9fjBtpkLx)ZVRF)baxJVc2ydQ7J2wjF7rlJYcjFPsmRDuzIiSWvQO8)bODG8oZZPckk(zEW9f41Go4KarrLEvkQhL1)ioEjUBowQgUBLfQJg9)n
Is the custom text on "trigger update" shown as part of the "bufftrigger2" system for profiling ?
So I did a quick test in a raid group for a world boss and I couldn't reproduce the massive time taken. Granted only a few people joined, but there was no discernable fps drop on people joining.
I'll add something to the profiling which makes the custom text appear as a separate item. (In addition to being counted under the trigger). And leave it there. Hopefully with your change just works.
More on why the custom text could make it lags:
It use LibGetFrame to find a frame child of UIParent (recursively) with attribute unit matching the unit returned by bufftrigger2.
It's usually pretty fast, and frames found are cached so it's faster next time the GetFrame function is called, but the cache is invalided on PLAYER_REGEN_DISABLED, PLAYER_REGEN_ENABLED, GROUP_ROSTER_UPDATE
Also if a match is not found in the cache the recursive function is called again.
Problem i had here i think is that i'm in combat, i joined with close to an empty raid and more players joined, these players are not displayed on my unitframe until we get out of combat, so libgetframe cache never return the frame, and recursive function never find the frame, so it use a bit more resource than usual.
The trigger update code is not only run when players gain/loose buffs but maybe also if shield value change or something like that...
I just tested on "Ivus" with a 20+ raid already formed and had no issue. I added a print on trigger update to get an idea of how much it was called and it was very frequent, which was not un-normal considering the amount of buff tracked.
So i think bufftrigger2 is fine, problem was on my side and i was confused by profiling result showing the load on the trigger instead of the custom function.
I fixed the problem on libgetframe by blacklisting units for which no frame was found while in combat mrbuds/LibGetFrame@5169563