BugSack

BugSack

7M Downloads

Frame drops/freezes when opening BugSack with frequent long errors

0xjc opened this issue ยท 0 comments

commented

When an error occurs frequently (every frame) and the callstack context is long, opening BugSack can cause huge frame drops.

As a proof of concept if you import this WeakAura it will trigger an error every frame in a long function. Opening BugSack while the errors are still being generated freezes my game to <5 FPS. I know this is an artificial example but I have encountered this issue in the wild several times.

I have traced the issue to colorStack, which was taking 200ms/call with this example. Specifically this line:

ret = ret:gsub("([^\\]+%.lua)", "|cffffffff%1|r") -- Lua files

causes a lot of backtracking. Replacing it with

ret = ret:gsub("\\([^\\]+%.lua)", "\\|cffffffff%1|r") -- Lua files

fixes the problem.