valkyrnstudios / RankSentinel

MIT License
4 stars 2 forks source link

Move CLEU to it's own frame handler #75

Closed orionshock closed 1 year ago

orionshock commented 1 year ago

Can you move CLEU to it's own frame and event handler. I did this to my local copy and it improved my frame rate by at least 20.

    local frame = CreateFrame("Frame")
    frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    frame:SetScript("OnEvent", function() addon:COMBAT_LOG_EVENT_UNFILTERED() end)

is all you need in the OnEnable()

SabreValkyrn commented 1 year ago

Not sure I understand that reasoning.

Aside from using native frames instead of AceEvent wrapper, there shouldn't be a difference.

SabreValkyrn commented 1 year ago

Brought this up with another dev, he traced it down to

Thanks for bringing this to my/our attention, I'll make the optimization today

orionshock commented 1 year ago

Also your CLEU handling needs optimization. With out the addon loaded, I can get ~75fps in Dalaran. With it turned on I'm at ~35fps.

The order of operations inside CLEU should bail as early as possible so that it's not doing a lot of useless checks before realizing the player is idle out of group.

CLEU is a very very chatty event and it shouldn't be causing such a FPS loss.