arkinventory icon indicating copy to clipboard operation
arkinventory copied to clipboard

[BUG] Big FPS drops on opening bank, collecting mails and looting mobs (Retail)

Open Kiune opened this issue 2 years ago • 44 comments

What version number you are using? v31007.1

What game client are you playing? Retail, Burning Crusade, Classic / Live, PTR, Beta Retail Live

What language is the game client set to? English

Describe the bug When I open the bank window it shows all blank space and the game stutters badly (about 2fps) for about 5-10 seconds while it draws the icons in the bank tab. After the first time that it does this, it opens instantly but causes a few seconds of stuttering/lag and a drop in FPS from ~130 to 20. My bank is quite full with only ~20 slots free and all max size bags. I also have the same stuttering/fps drop when looting mobs, especially so when they are associated with a quest and especially when they have an item to loot from them for the quest. This issue seems to get worse over time and improves a bit with a /reload before getting bad again within a few pulls. It does not do this on every single mob but the more loot they have the more it lags. Opening the mailbox when it is full of items / Getting items out of the mailbox also causes the same stutter/fps drop. It still does all of these when Ark Inventory is the only addon, but it does it more severely when other addons are loaded. I have noticed this problem appear somewhere in the last few updates (at least 3 updates back as I hoped the last 2 updates would fix it).

To Reproduce For the bank: load up game with ark inventory enabled and open bank tab. For the mob looting: load up game with ark inventory enabled. Find a quest where the mobs have a lootable item and kill them then loot. The effect is more pronounced when aoe looting, and especially obvious if looting while running past. As an example of the quests that trigger this, I was getting very bad lags on the Korthia daily where you collect Mawsworn tokens. For mailbox: open mailbox when there are a lot of mails with items in and try to retrieve the items.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. In debug mode I see that the addon is often spamming bag updates every few seconds even when bags are not open. I'm attaching a text file where I've copied several instances of debug output and a brief description of what I was doing at the time. AIdebug.txt

Kiune avatar Nov 21 '22 02:11 Kiune

I can second this.

Have strong FPS drops specially on looting mobs, opening the bags and most especially opening the bank. The First time opening any bag / bank after logging in, it takes a while (5-10 seconds) to load every icon. After that the loading part is faster, yet the fps drops are still occuring from 144 down to 12.

This still occurs if I only have ArkInventory activated, and doesn't when I use default bags or elvui ones. Also tried removing the Clean Icons set and using default skins and again fps drops happened.

I don't use any rules but sort my bags some custom categories I don't know if that causes problems.

Paladin7788 avatar Nov 21 '22 03:11 Paladin7788

Can confirm this behavior as well. Seems to compound as long as the session is active with every subsequent looting/inventory interaction leading to larger frame spikes.

Eventually in many cases for me, the entire UI becomes hidden (equivalent of Alt-Z) except that pressing Alt-Z has no effect. The only fix for this is typing a reload UI command (without being able to see any chat frame... since it's completely gone). Not confirmed that ArkInventory is specifically to blame for the UI disappearing, but it has only happened during the gigantic lag spikes from looting/opening bags/bank/restack/mail.

Will enable debugging on co-routines and see if any interesting logging is noticed.

ImUnicke avatar Nov 21 '22 04:11 ImUnicke

Ok, well one of the lag spikes caused by AI after looting is apparently a thread which is scanning every item that is currently equipped, every time an item enters the inventory. Looting with a full bag does not cause this thread to run. Not really sure the purpose behind that if intended? Edit: Removing an item from your inventory also triggers this wearing re-scan. image

ImUnicke avatar Nov 21 '22 04:11 ImUnicke

do you have sorting set to instant? if you do could you change it to onopen or preferable manual

i scan what you are wearing so thats normal. should only be an issue if it takes a long time

arkayenro avatar Nov 21 '22 05:11 arkayenro

Tested myself with sorting to manual, and problem persists. AI is only addon loaded. Disabling AI causes 0fps drops and zero noticeable lag or stutters, but it does cause eye cancer from looking at default bags. Should also note, the lag gets worse over time and includes any instance of items entering bags, such as anima from daily quests in Korthia or ZM.

QuickEdit: Sorting set to manual also still causes an FPS drop when just opening my regular bags. Not as hard as looting, but drops to 30fps from 120fps, and drops to 10-15fps from 120fps when looting.

Modreyn avatar Nov 21 '22 05:11 Modreyn

do you have sorting set to instant? if you do could you change it to onopen or preferable manual

Sorting was 'On Open' for the above debug output. image

i scan what you are wearing so thats normal. should only be an issue if it takes a long time

Well, define 'long time' because a 100ms+ stutter after every time any item is looted or destroyed from my bags is definitely not enjoyable. It seems to detect an actual equipment change when I change worn equipment (likely by registering PLAYER_EQUIPMENT_CHANGED) so I'm not sure the purpose of scanning it after looting.

Curiously, the auto-sell functionality of AI does not trigger the re-scan of my worn equipment, nor does buying something from a vendor.

ImUnicke avatar Nov 21 '22 06:11 ImUnicke

This equipment scan is quite lengthy... every piece is scanned within one frame and some items take a long time to scan. This particular scan operation froze my game for approximately a full second, with some items individually taking over 100ms to scan. image

ImUnicke avatar Nov 21 '22 06:11 ImUnicke

Just now opened my bank again (same game session from before, mainly afk in Garrison) and every 'chunk' of thread scanning for the bank (set to 25ms) reported 25ms wait in chat, but also caused about a 500ms+ frame skip for every chat message. Finally about a full minute went by of the entire game stuttering at 1-2 FPS and my entire game UI disappeared and the lag went away. The bank frame is technically still open even though invisible since I can click and pick up items onto my cursor by clicking randomly on the game world. This might be an issue with the new game UI as well, hard to know when everything disappears...

ImUnicke avatar Nov 21 '22 07:11 ImUnicke

thats weird, the scan times should get shorter.

i think its the one place i never added yielding to, which would explain why it could end up locking instead of just stuttering. i'll double check all of them and add yielding in, that should help to alleviate the issue, but may not get rid of it completely.

i can probably get rid of UNIT_INVENTORY_CHANGED as its calling the same function as PLAYER_EQUIPMENT_CHANGED anyone, that should help to alleviate some of the events where its not required to update anything as the other events should cover it.

the debug output makes it worse. the ui disappearing im beginning to think tis due to too many of threads not yielding so are hitting the timeout limit - which typically spits out an error but maybe blizzard changed something else. either way try dropping the thread timers down to their minimums, 25ms and see if that helps any. it wont were there is no yielding but that will be fixed next release.

arkayenro avatar Nov 21 '22 07:11 arkayenro

i can probably get rid of UNIT_INVENTORY_CHANGED as its calling the same function as PLAYER_EQUIPMENT_CHANGED anyone, that should help to alleviate some of the events where its not required to update anything as the other events should cover it.

That will be nice! :)

ImUnicke avatar Nov 21 '22 10:11 ImUnicke

try 3.10.07 alpha 3

arkayenro avatar Nov 21 '22 10:11 arkayenro

In debugging this, I've also realized that due to the new 10.0 API for tooltip interactions that there's a horrible side-effect of how some tooltip logic was changed recently (by me) for AllTheThings. And I'm fixing that now as well since it was causing some expounding effects of the situations that AI was causing.

I'll try out that alpha as well.

ImUnicke avatar Nov 21 '22 10:11 ImUnicke

im guessing part of this is going to come back to the new tooltips, those caused massive amounts of lag at first but i thought my new code had it under control. maybe not. i'll have to revisit that at some point.

arkayenro avatar Nov 21 '22 10:11 arkayenro

try 3.10.07 alpha 3

Yea huge improvement with both fixes combined now (ATT & AI). Basically 0 lag when swapping equipped gear.

Also much more subtle stuttering after looting.

This is the extent of the AI debugging output after looting a single Item: image

Ah though, it seems the Item equipping didn't properly re-scan the player... upon cursor-over the newly-equipped item, AI is showing it both in my bag and wearing. image

And the debug output doesn't seem to indicate any checks of equipped gear: image

ImUnicke avatar Nov 21 '22 10:11 ImUnicke

the start output was commented out, its mostly just for better visibility as wearing is location 6 which is all the scan-6 lines.

not sure whats going on with your tooltip though. mine is updating but it can sometimes take a second to get through the queue and rebuild and refresh.

arkayenro avatar Nov 21 '22 10:11 arkayenro

Hmmm, yea not sure.

If you were interested in seeing what I fixed for AllTheThings and tooltips, you can see here. Basically since AI generates various tooltips for 'scanning' to know how to apply rules and such, ATT was basically hooking into all of those (since the 10.0 API has no way to prevent that which I could tell), and in some situations causing huge lag spikes. Now, they will be ignored and the lag spikes are gone.

ImUnicke avatar Nov 21 '22 11:11 ImUnicke

Can confirm that alpha3 is a considerable improvement.

Since 10.0.2, until yesterday I got FPS meltdowns and sometimes UI knockouts all day long (retrieving mail, AH posting, looting, extensive bank restacking to the new stack sizes, …).

This is way more manageable with alpha 3 now, I got only one UI knockout today while retrieving ~130 mails on my AH toon. This might also be related to a weird tooltip phenomenon when retrieving mails: Frequently – but not always – I get a tooltip seemingly for every single mail (with attachment) that is retrieved, even with the cursor being far away from the mailbox frame.

I have yet to find out if or what addons are involved in this. When I saw the ATT/AI 'conflict' mentioned here, I went to test that, but currently the phenomenon refuses to show itself, with or without addons.

tflo avatar Nov 21 '22 16:11 tflo

Thanks for looking at this! I've tested out alpha 3 and there is a significant improvement in the mailbox lags. However the bank is still doing an FPS drop and taking ~6-10 sec to load for the first time after reload (meanwhile showing all blank space where slots should be). With AI as the only addon loaded it still takes ~5 seconds to load up the bank. After the first time opening the bank it opens instantly but still does an fps drop of ~40-50fps. (Note to add, I do also use AllTheThings and ensured to disable it while testing since ImUnicke mentioned it also has a similar issue and I don't have a fixed version of that running - thanks for looking into this too ImUnicke!)

Kiune avatar Nov 21 '22 18:11 Kiune

Further to the above looting seems improved as well (microstutter still but nothing like before, and mostly ignoreable). However it seems to have forgotten how to sort some items - I got a soulbound armor item show up in my BoE equipment container and a bunch of stuff in my bank has forgotten where it used to live and just gets dumped in the general tab.

Kiune avatar Nov 21 '22 23:11 Kiune

I'm seeing the framedrop all but gone in alpha 3. Looting from any source, even with all of my addons loaded, gives maybe a 1-3fps drop, which at a steady 100-120 normally means nothing to me.

Thanks ark! Best addon ever

Modreyn avatar Nov 22 '22 04:11 Modreyn

try alpha 4 and let me know if the first load is better (theres only so much i can do to lower this though)

arkayenro avatar Nov 22 '22 09:11 arkayenro

Hi, I tested alpha 4. I have hunderd items in bags, bank, void storage, guild bank etc. I use many rules, but not all in all locations.

  • First Bag open (after login) is still lagy.
  • When I go back to Bag repeatedly, all is OK.
  • When I go back to Bag after unspecified time, lags is back (same as after first Bag open).
  • First going through Guild Bank slots caused UI disappearing.
  • FPS drop is to 10 FPS, from 60 FPS, to 5-10 secs.
  • Disabling addon part "ArkInventory [Rules]" very help with lags, but don't remove them.

My hardware:

  • CPU: Intel Core i9-9900K
  • VGA: Nvidia RTX 2080 Ti 11GB
  • RAM: 32GB 3200MHz
  • SSD: Samsung 970 PRO 1TB

I love this addon and would be happy to help with anything to debug it if I can.

Here is screenshots of my Bag, Edit Mode and enabled Rules. image image image

Horogg avatar Nov 22 '22 11:11 Horogg

Tested the newest alpha build (it was alpha 5 by the time I was able to test - can roll it back to 4 if you prefer). Bank lag is definitely vastly improved (only lags ~1 sec with only AI and 1-2 sec with all addons enabled now - which is definitely liveable) and has a shorter fps drop when opening it afterwards. It's more comforting that there is "something" in there now rather than blank space before it fully loads the first time. Haven't had any more problems with it forgetting where things should be sorted. Fingers crossed! Thanks for pushing out a fix for this so quickly :) Edit: forgot to disable AllTheThings (which had the too-many-tooltips issue version) while testing the addons enabled, disabling that took bank load from 2-3 sec with all addons to only 1-2.

Kiune avatar Nov 22 '22 19:11 Kiune

go into the config and disable tooltips. it will be annoying but see if you can play for a while like that and if the issues are still there. farming sessions are probably a but easier for this as you dont need to see whats there.

arkayenro avatar Nov 23 '22 06:11 arkayenro

actually dont bother, it looks like blizzard put back the moneyframe onto the tooltip (i took it out in 3.10.03) and its causing five hundred plus moneyframes to be added to my scan tooltip lust on entering the world so who knows how many it adds over time.

i've put it back in and now theres only a single moneyframe so hopefully this is whats been screwing things up.

arkayenro avatar Nov 23 '22 06:11 arkayenro

please try 3.10.07 alpha 6

arkayenro avatar Nov 23 '22 07:11 arkayenro

Alpha 6 is success for me.

  • First Bag open (after login) ..... lag is very small, same as before this bug. FPS drop is to ~8 secs.
  • When I go back to Bag repeatedly ..... OK
  • When I go back to Bag after unspecified time ..... OK
  • First Bank open (after login) ..... lag is very small, same as before this bug.
  • First Void Storage open (after login) ..... lag is very small, same as before this bug.
  • Looting many items in same time ..... OK
  • First going through Guild Bank slots ..... OK (no lags and without UI disappearing)
  • Global Search ..... OK (in Alpha 5 and prev, was very very lagy and cause UI disappearing)

Additional info:

  • In Aplpha 5 with disabled tooltips was still issues.
  • I have items Equip type "Back" (Cloak) on which not work rules ..... Problem is in wearable() I created separate issue with fix description ... https://github.com/arkayenro/arkinventory/issues/1689

Horogg avatar Nov 23 '22 10:11 Horogg

Alpha 6 is success for me.

Can confirm. First bank opening is now 0.7s or so :)

tflo avatar Nov 23 '22 13:11 tflo

Alpha 6 is a vast improvement and lags are either gone or not noticeable, even with other tooltip addons running. Bank opening is <1sec with all addons on, haven't seen looting cause stutters now either. I feel like I'm also getting better fps just running around out and about as well. I guess money really is evil!

Kiune avatar Nov 23 '22 21:11 Kiune

anyone still having issues using 3.10.09 ?

arkayenro avatar Nov 24 '22 07:11 arkayenro