Thread: Beginner
View Single Post
03-31-18, 03:14 PM   #25
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
Originally Posted by JDoubleU00 View Post
This is a good list of steps for troubleshooting addons. Give it a look and see if anything can help you locate the source of your lag (unless it is 700 Weak Auras). Your whole UI is made from Weak Auras? <mind blown>
Only unit frames, and some other stuff, like rogue combo points. And there is not 700 auras enabled at same time

I think i know what can be cause laggs. Many auras has the same code on init, like:

local char
local string_byte = string.byte
local sub = sub

local function chsize(char)
if not char then
return 0
elseif char > 240 then
return 4
elseif char > 225 then
return 3
elseif char > 192 then
return 2
else
return 1
end
end

function aura_env.custom_utf8sub(str, startChar, numChars)
if not str then return "" end
local startIndex = 1
while startChar > 1 do
local char = string_byte(str, startIndex)
startIndex = startIndex + chsize(char)
startChar = startChar - 1
end

local currentIndex = startIndex

while numChars > 0 and currentIndex <= #str do
local char = string_byte(str, currentIndex)
currentIndex = currentIndex + chsize(char)
numChars = numChars -1
end
return str:sub(startIndex, currentIndex - 1)
end

function aura_env.utf8len(str)
if not str then return 0 end
local len = 0
local currIndex = 1
while currIndex <= #str do
local char = string_byte(str, currIndex)
currIndex = currIndex + chsize(char)
len = len + 1
end
return len
end

But normally it should be loaded only one time. Or for example if i have the same code for color box, that loads twice, like player and target. That can be the issue, but im not at 100% sure.

Last edited by GreyFox777 : 03-31-18 at 03:27 PM.
  Reply With Quote