lua-users home
lua-l archive

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



Ok this is surely not complete test benchmark nor some news for everybody :oP

So I had to do some benchmarking of 3 scripting languages and I thought I might share what I found.

so languages are:
autoit, sometime really useful windoze interface script not fast but useful :o)
python3.4 ...
lua5.3  interpreter
luajit current version

the benchmark, well I cannot really share here the code for the moment, but I can tell you what it is :o)
basically I dusted off my rubik cube and decide to modelize it
so a cube is a 54 array of letter (color of the block)
on whitch I can apply 18 different moves of a face,
a move is a 54 copy, or a copy of an indirection array acces, of a letter

   for x = 1, 54 do
        if m[x] == 0 then
            cb[x] = ca[x]
        else
            cb[x] = ca[m[x]]
        end
   end

each cube are of course compare to a destination cube.
there is not creation of array dynamically I use a stack of pre allocate arrays for the solution tree so something of 20 arrays so in this way, I am not really testing the garbage collector instead of what I wanted to test...
so implementation is fairly the same for all 3 languages.
so a 5 move deeps path tree bring around 1900000 face moves and cubes equality test

so here the result
autoit - 180sec
python3.4 - 14sec
lua5.3 - 6.4sec
luajit - 0.5 sec
c/c++ (  maybe soon )

In some ways this confirm test on the web, but I prefer also do my own test and see :o)

Noob ducking now ...  and looking if a language war is starting :oP