Originally Posted by rowaasr13
If you use early returns the data is not even instantiated. Otherwise it all depends on how you programmed if you just build big table of all localization and never throw it away - it will stay in memory because, well, you put it here and didn't dispose it. Just don't do that.
There also source text and outer function bytecode itself - only Blizzard can tell if those are retained in memory after processing or not.
|
Try to login with the game with 5k "L" tables in every localization, then try to log in with only one set of tables, then compare the memory usage:
Lua Code:
local AddonName, Addon = ...
local L = setmetatable({ }, {__index = function(t, k)
local v = tostring(k)
rawset(t, k, v)
return v
end})
Addon.L = L
local locale = GetLocale()
if locale == "enUS" or locale == "enGB" then
elseif locale == "deDE" then
elseif locale == "esES" then
elseif locale == "esMX" then
elseif locale == "frFR" then
elseif locale == "itIT" then
elseif locale == "koKR" then
elseif locale == "ptBR" then
elseif locale == "ruRU" then
elseif locale == "zhCN" then
elseif locale == "zhTW" then
end
It doesn't really matter if your code doesn't run, if you put a file in the toc, then it will get loaded into the memory at least once per login/reload. My guess is that memory eventually will get garbaged, but it's still unnecessary loading time.