lua-users home
lua-l archive

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

On Mon, 2008-03-10 at 11:35 +0100, Mister White wrote:
> Hi everybody, 
> I'm making a little of benchmark with lua and I'm comparing it with
> Java.
> I tried to implement Whetstone and dhrystone algorithms and I get the
> following results:
> Whetstone
> Java: Execution time: 0.125 seconds 
> Lua:  Execution time: 1.453 seconds.
> Dhrystone: 
> Java: Execution time: 0.938 seconds
> Lua: Execution time: 13.609 seconds
> These kinds of results are strange. Is java fastest than lua?
> Or I did something wrong implementing these algorithms?

Remember that these benchmarks are pretty meaningless in and of
themselves.  Also remember that Java is most likely being JITed, and has
an integer type, where neither of those is the case with stock Lua.

Try using Mike Pall's excellent LuaJIT and rerun your benchmark.  Also
measure memory consumption over the lifetime of the benchmark, and
include start-up cost in your measurements for more interesting figures.

You might also want to post the sources to both the Java and the Lua
implementations here for people to scrutinise.