Lag spikes
Addon Version
v0.3.18
World of Warcraft Version
Retail
Describe the bug
Loading into the game, looting a kill, or interacting with vendors all cause major lag - it's easily visible by the stutter in movement of npcs, mounts, etc.
I've turned off every addon and the game works fine. I've gone through every other addon one by one. I've seen similar looting issues mentioned on the WoW forums, so I've played around and removed BB from my addon folders, removed everything except BB, done a fresh install of BB, etc. and it is most definitely BB causing the issue for me.
Also, using any BB plugins from the smaller Tabards to the larger AIO (All In One) makes the effect worse. Last night I clicked on a vendor and the game actually crashed. That's when I finally decided to narrow down the culprit.
I'm not getting any warnings or anything from wow.
I've added a small edited clip with BB off and then on. This is just the minimal amount of stutter, it gets worse when looting a lot (dungeons, delves, etc), or if you start using plugins with it.
I'm not smart enough when it comes to addons to figure out why it's happening. :(
Steps to reproduce
Load game. Click on vendor - it lags. Close vendor - lags.
Kill something (any level) and loot - lag.
Enable a bb plugin - lag becomes worse. (The AIO plugin is the worst of the ones I've used and I'm also going to let the creator know, but this happens even with all plugins not just disabled but straight up deleted from the addon folder.) Disable bb plugin - still lags, but recovers faster.
https://github.com/user-attachments/assets/82625160-1164-429b-8a62-c2de6c9759fa
That's a micro-stutter. The add-on was causing the issue for me, too. It's off now, and there are no micro-stutters.
I used Numy's Addon Profiler addon to pull some data. Version 0.3.18 no longer seems to work in Retail, 0.3.20 is the oldest version working. All versions from 0.3.20 - 0.3.26 exhibit the same behavior - large lag spikes on logging in, looting, and opening bags. Addon Profiler shows multiple script runs > 1000ms.
Test methodology:
- Enable only BetterBags (no plugins) and AddonProfiler
- Log in: lag / FPS drop to single digits for 1-2 seconds
- Open bags: very minor lag
- Kill something and loot: lag / FPS drop to single digits for 1-2 seconds
- View statistics in Addon Profiler
0.3.26:
0.3.20:
On further investigation, this doesn't appear to be an issue with a base installation of BetterBags, but an issue in how plugins interact with BetterBags categories. Once a plugin is activated, the categories it creates are baked into /WTF/Account/Foo/SavedVariables/BetterBags.lua, and so continue to be active even with the plugin disabled. Wiping those plugin categories from the saved variables, I no longer see lag spikes.
In my case, I had previously used multiple plugins which had resulted in an 800kb file with over 1700 categories. The main cause in my case seems to be BetterBags - Appearances with the Split by Item Location / Split by Item Type options enabled, which results in over 1000 categories being created, and those categories persist in BetterBag's DB even after the plugin is removed.
Possible fix, but this would almost certainly represent a breaking change for plugin authors: Start tracking the "owner" of categories (base categories, user created, plugin created) and remove the categories when the associated plugin is no longer active.
this won't be fixed in the current iteration of the addon, but yes, this remains a problem if you have too many categories. ultimately, if you have too many categories, there's not much to be done.