lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Mar 18, 2007, at 3:51 AM, Gé Weijers wrote:


On Mar 18, 2007, at 4:39 PM, Lothar Scholz wrote:

I must say i think the same same. I like the programming model but it
is very slow and i really don't know why the design of lua wants to
use slow hashtable access anywhere. My performance tests show that for
function calls there is a lot (i really mean a lot) room for
optimization.

Warning for those reading this message: "There are lies, damn lies, and benchmarks"

[...]

I also implemented the same function in a number of other languages. On my PowerPC Mac laptop I obtained the following results:

	C: 97301516   (optimization flag: -O3)
	C: 34003218   (no optimization)
	Lua: 3119095
	Python: 1077014
	Perl: 453289

Relative to Lua's performance:

	C: 31.20   (optimized)
	C: 10.90   (unoptimized)
	Lua: 1.00
	Python: 0.35
	Perl: 0.15

Lua is quite a bit faster than the common interpreted languages I tried. The optimized C performance number is unrealistically high because the compiler performs a kind of inline substitution to lower the number of recursive calls made. If your turn that off the speed advantage relative to Lua drops to 10.9.

It seems to me that Lua is doing very well relative to the established scripting languages, at least in the function call department.

For another take on this topic, consider http:// shootout.alioth.debian.org/. In my tests, Lua is faster than Python and Perl in almost every category. The places where it is slower, is probably due to poor Lua test implementations, an not Lua itself.

- -Brent
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFF/eQ+zGDdrzfvUpURAgE7AJ41hhsU18m+XwwxlimvB/8ElzZcugCeMdk4
9BqTogY5nfj7VOYjBXM58cU=
=Lq/g
-----END PGP SIGNATURE-----