lua-users home
lua-l archive

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


These benchmarks assume naive programmers for the languages, making them useless. 


For example lua benchmark, didn't use locals  or table.concat

 
io.stdout:setvbuf "no";             --  io.flush();

-- didn't use local for variables
local str='abcdefgh'..'efghefgh';
local imax=1024/string.len(str)*1024*4;         -- 4mb

local starttime=os.time();
print "exec.tm.sec\tstr.length";

gstr='';
local i=0;

while i < imax+1000 do
        i=i+1;
        gstr= table.concat({gstr}, str) -- was gstr=gstr..str
        gstr=string.gsub(gstr,"efgh","____");
        lngth=string.len(str)*i;
        if(math.mod(lngth,1024*256)==0) then
                print(os.time()-starttime.."sec\t\t"..(lngth/1024).."kb");
        end
end


On Mon, Jul 15, 2013 at 12:54 PM, Liao Yu Lei <liaoyulei@qeeplay.com> wrote:
Great, but where is LuaJIT ?


On Tuesday, July 16, 2013 at 12:48 AM, Daniel Bolgheroni wrote:

> Maybe this should be of interest:
>
> http://raid6.com.au/~onlyjob/posts/arena/