Here are some preliminary benchmark data I’ve obtained for Python and Lua. Many of the programs failed, probably required extra libraries which I did not install. The following results show only those where BOTH a Lua and Python program worked. In those cases where there were multiple programs working per language, only the fastest (average) was taken. Each program was run 6 times and the average of the last 5 were taken (except nbody which was run 10 times with the average of the last 9 taken). The unit used is seconds (lower = better):
binarytrees lua .939
binarytrees python 1.789
fasta lua .872
fasta python 2.362
mandelbrot lua .904
mandelbrot python 1.399
nbody lua 1.672
nbody python 4.357
spectralnorm lua .912
spectralnorm python 13.924
Using:
- Lua 5.1.4 (Cygwin 1.7)
- Python 2.6.5 (Cygwin 1.7)
- Windows XP SP3
- Intel Pentium 4 Processor: 2.8 GHz (single-core)
Due to the non-controlled nature of this run, the results should not be taken seriously. Nonetheless, it does allow for some (potentially erroneous) generalizations. For one, Lua appears to be significantly faster than Python on Cygwin. This could be that Python is using some slow OS-dependent features which Cygwin then needs to emulate as POSIX thus slowing things down. I don’t know the inner workings of Python so I have no idea what Cygwin could possibly be emulating for it. I do know that Lua is essentially ANSI C (except the loading library which is not used in these tests) and so there’s probably nothing much for Cygwin to emulate.
More results may come in the near to distant future when I get more languages working.
