BugSack icon indicating copy to clipboard operation
BugSack copied to clipboard

Frame drops/freezes when opening BugSack with frequent long errors

Open 0xjc opened this issue 5 years ago • 0 comments

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.

0xjc avatar Sep 11 '20 05:09 0xjc