lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi folks,

Here's what I finally came up with:

Using table.show from here: http://lua-users.org/wiki/TableSerialization and the logging package:

function dumpLargeGlobals()
   if not config.dumpLargeGlobals then return end
   for k,v in pairs(_G) do
       local v2 = table.show(v,"v")
       if v2:len() > 3000 and k ~= "_G" and k ~= "package" then
           logger:debug(table.show({GLOBAL=k,value=v2:len()}))
       end
   end
end

It's not exact, but it gives me a pretty nice relative benchmark. Here, I'm dumping any structure/string whose string representation is > 3K (an arbitrary number I chose).

HTH someone else.

Mike