AlterEgo

AlterEgo

39k Downloads

Performance issue related to new key obtained / bag scanning.

arcadepro opened this issue ยท 3 comments

commented

Since you added the functionality to check if the player has looted a new keystone (announce new keystone) you have registered
"BAG_UPDATE_DELAYED",
and
"UNIT_INVENTORY_CHANGED",

I'm not sure which one of these is the cause but what happens is the following:

Whenever the player loots a new item, a few seconds later the game stalls for a few hundred frames. This causes a frame rate hiccup every time you loot items out in the world.

After spending a few hours looking into all of my addons I found that commenting out these two events in your addon fixes the issue. I assume that whatever code you're running takes a while to complete. I suggest you only scan inventory for new keys if the player is either in Valdrakken or inside of a Mythic difficulty instance (or on player login too I guess).

(I have both 'announce new keystone' options unticked within the addon but this inventory check is still taking place anyway.)

commented

Yes. It's how I noticed it. By looting mostly Tuskar Tackle Boxes in the Waking Shores. The fps blip is small but repeatable by doing this.

I'd start by un-registering the inventory events if someone is opted out of the the key announcing feature maybe.

You also don't need to be checking for a new key on every loot pickup as this can only ever happen in Valdrakken or in a Mythic dungeon.

commented

@arcadepro Appreciate it. Will investigate and optimize however I can ๐Ÿ˜„

commented

@arcadepro Hi there ๐Ÿ˜„

Thanks for taking the time to report this.
I've been in bed sick with a virus all week, so I've only just now seen your ticket.

Granted, maybe there's a performance issue with hardware different than mine, however scanning the bags shouldn't have a hiccup like that (a ton of addons/weakauras do this as well).

Anyway I'd love to figure out what can be done to improve this, so first of all I'd like to ask you if you can reproduce this consistently? If you loot anything in the world with just this addon enabled, does it stutter the game for you ?