ALL THE THINGS

ALL THE THINGS

31M Downloads

Stutter/framedrop from CRITERIA_UPDATE event

Ophidon opened this issue ยท 9 comments

commented

Hello,

I believe I have found a source of a small (only ~8ms but enough to double my frametime, aka a full frame drop at 120fps) yet consistent refresh stutter in ATT when essentially nothing is going on that should be triggering any refresh.

The CRITERIA_UPDATE event is seemingly triggered on every single jump I make. I don't know -why- jumping triggers this event, maybe for the old fall 60yd achievement? Anyway, this then triggers a refresh that causes this stutter, and I've verified commenting out that event trigger solves it. I do realize this event will also occur for more valid reasons, but for my own purposes, slightly out of date data is far preferable to addon induced stutter when I'm not doing anything but moving around out of combat.

Would a settings option to enable/disable updating on this event be a possibility?

commented

Interesting... I remember testing when I added that event trigger (to capture much more accurately when certain triggers happen in the world) it was basically negligible, and that was on my main character with nearly 20K quests being checked in that window of time.
I'll give it another look though and maybe see if I can unhook from that event unless a prior event takes place (like looting, boss kill, etc.) that could then hook the CRITERIA_UPDATE until the next time it fires. This would likely remove a large portion of the 'unnecessary' checks taking place that you are experiencing.

commented

Is this on Retail or Classic?

commented

This is on retail. Thanks for looking into it!

commented

This is on retail. Thanks for looking into it!

As a test on your side @Ophidon, if you allow that event to remain hooked, but comment out the highlighted line, do you still notice the stutter at your exceptional FPS? I believe this might be unnecessary logic due to other improvements from within the quest refresh check, but haven't had much time to evaluate much testing on it in the game.
image

As a side note, when I enable some debugging output for checking time durations for these operations, the quest check is still under 1 frame at about 240FPS, but the window refresh typically can take a bit longer depending on how many ATT windows are currently visible on your screen. Hence why removing that portion from the event trigger might be the actual stutter you are noticing.

commented

Hi,

Sorry for the delay getting back.

I tried to comment out just that refreshwindows() call but the stutter remains.

criteria_update_stutter

To test that I'm going to a non busy area where the frametime stays perfectly flat without some form of obvious intervention/event. And those 3 spikes are from right after 3 jumps.

Strangely, based on what you said though, the reverse works for me. Commenting out the refreshquestinfo call but not the refreshwindows call, even with the main att window open, causes no apparent stutter. I'm at a lower number of quests than what you listed as well, 15748 according to dataforazeroth currently.

commented

@Ophidon Are you on ATT 2.9.12 for that previous test? I did make a few performance improvements in the quest refreshing logic, though it's probably not quite enough to make it within a single frame above 60+ FPS with many so quests completed on your character. With my slightly adjusted debug logging, my main character now would get frame stutter above ~75 FPS or so typically due to the number of quests, whereas most alts with less quests wouldn't see stutter unless I was getting 300+ FPS.

In time maybe can have an option to scale the cooldown of how often this check is allowed to take place, but that's a bit more work concerning the UI side and I think there are other things that are a bit higher priority.

commented

I was still on .10, but I have updated to .12 now. No real change.

Hmmm unfortunate :/

I did like your original idea of trying to only trigger on this event if it follows another sensible event, which would at least remove the stutters during the times when you're just moving around (aka jumping) and more likely to notice a single dropped frame than when you have just killed/looted/turned in a quest/etc anyway. (Though with killing mobs a cooldown still might be good so it doesn't trigger every single mob death in an aoe pull I guess).

Yes, though unfortunately there are situations where it is required but there are no pre-emptive events that could hook it. For instance, the light-up flowers in Ardenweald for opening the bulbs. Those are captured while flying on your mount through the flowers.
There's already a 1 sec cooldown on the quest refresh itself, and re-hooking the criteria event, so at most it will fire one per second currently (even when you change your armor and CRITERIA_UPDATE triggers 16 times at once). Apparently that's about the exact amount of time a standard jump takes in the game.

commented

I was still on .10, but I have updated to .12 now. No real change.

I did like your original idea of trying to only trigger on this event if it follows another sensible event, which would at least remove the stutters during the times when you're just moving around (aka jumping) and more likely to notice a single dropped frame than when you have just killed/looted/turned in a quest/etc anyway. (Though with killing mobs a cooldown still might be good so it doesn't trigger every single mob death in an aoe pull I guess).

And it wouldn't involve a front-end option that would that would add to the already substantial list and have to be explained what its for.

Either way, thanks once again for actually looking into this. :) Worst case scenario I can keep just commenting it out after every update just for my own purposes lol.

commented

@Ophidon In case this is still bothering you, I implemented a new algorithm for our detection of quest changes which are not reported via events directly (i.e. treasures etc.) and this functionality is what runs during the CRITERIA_UPDATE event.

The good news is that this check is roughly 3x faster than before, meaning you'd need to be getting 360FPS to notice a skipped frame now if you previously noticed one at 120FPS ๐Ÿ˜„

Going to close this, re-open if there's still noticeable stutter after the next release ATT 3.4.7