lua-users home
lua-l archive

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


On Tue, Jul 7, 2015 at 8:47 PM, voidptr <voidptr69@gmail.com> wrote:
>
> 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
>
>

One more benchmark [1]

local cc = 0
for i = 1, 1000 do
  for j = 1, 1000 do
    for k = 1, 1000 do
      if i + j == k then
        cc = cc + 1
      end
    end
  end
end
print(cc)

Languages:
 * C
 * Python
 * PyPy
 * Python converted to C++ using shedskin
 * Java + GCJ
 * D
 * Lua + LuaJIT
 * JavaScript
 * Perl
 * Haskell
 * Ruby

[1] https://github.com/starius/lang-bench



-- 


Best regards,
Boris Nagaev