diff options
Diffstat (limited to 'tex/context/base/luat-sto.lua')
-rw-r--r-- | tex/context/base/luat-sto.lua | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/tex/context/base/luat-sto.lua b/tex/context/base/luat-sto.lua index fddf262c2..30bb7d5bb 100644 --- a/tex/context/base/luat-sto.lua +++ b/tex/context/base/luat-sto.lua @@ -12,9 +12,7 @@ local type, next, setmetatable, getmetatable, collectgarbage = type, next, setme local gmatch, format, write_nl = string.gmatch, string.format, texio.write_nl local serialize, concat, sortedhash = table.serialize, table.concat, table.sortedhash local bytecode = lua.bytecode -local strippedloadstring = utilities.lua.strippedloadstring -local trace_storage = false local report_storage = logs.reporter("system","storage") storage = storage or { } @@ -64,14 +62,11 @@ local function dump() end max = max + 1 if trace_storage then - c = c + 1 ; code[c] = format("print('restoring %s from slot %s')",message,max) + report_storage('saving %s in slot %s',message,max) + c = c + 1 ; code[c] = format("report_storage('restoring %s from slot %s')",message,max) end c = c + 1 ; code[c] = serialize(original,name) - if trace_storage then - report_storage('saving %s in slot %s (%s bytes)',message,max,#code[c]) - end - -- we don't need tracing in such tables - bytecode[max] = strippedloadstring(concat(code,"\n"),true,format("slot %s",max)) + bytecode[max] = loadstring(concat(code,"\n")) collectgarbage("step") end storage.max = max @@ -108,24 +103,9 @@ end --~ end statistics.register("stored bytecode data", function() - local nofmodules = (storage.nofmodules > 0 and storage.nofmodules) or (status.luabytecodes - lua.firstbytecode - 1) - local nofdumps = (storage.noftables > 0 and storage.noftables ) or storage.max-storage.min + 1 - local tofmodules = storage.tofmodules or 0 - local tofdumps = storage.toftables or 0 - if environment.initex then - return format("%s modules, %s tables, %s chunks, %s bytes stripped (%s chunks)", - nofmodules, - nofdumps, - nofmodules + nofdumps, - utilities.lua.nofstrippedbytes, utilities.lua.nofstrippedchunks - ) - else - return format("%s modules (%0.3f sec), %s tables (%0.3f sec), %s chunks (%0.3f sec)", - nofmodules, tofmodules, - nofdumps, tofdumps, - nofmodules + nofdumps, tofmodules + tofdumps - ) - end + local modules = (storage.nofmodules > 0 and storage.nofmodules) or (status.luabytecodes - lua.firstbytecode - 1) + local dumps = (storage.noftables > 0 and storage.noftables) or storage.max-storage.min + 1 + return format("%s modules, %s tables, %s chunks",modules,dumps,modules+dumps) end) if lua.bytedata then |