lastmem, lastmax = gcinfo(); tab = {}; repeat local s; --[[ Test using split split(thestring); --]] --[[ Test using split2 split2(thestring); --]] -- Test using split2 with table argument split2(thestring, tab); --]] --[[ Test using gfind for s in string.gfind("hello.mighty.world.dominating.program", "[^.]+") do end --]] --[[ Test using local variable allocation local a = "hello"; local b = "mighty"; local c = "world"; local d = "dominating"; local e = "program"; --]] --[[ Test using find local init, mstart, mend = 1; repeat mstart, mend, s = string.find(thestring, "([^.]+)", init); if ( s ) then init = mend + 2; end until not s; --]] mem, max = gcinfo(); if ( lastmem ~= mem or lastmax ~= max ) then lastmem, lastmax = mem, max; print(mem, max); end until false