lua-users home
lua-l archive

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


Mike Pall writes:

> Tom Spilman wrote:
> >  The Great Computer Language Shootout has a new maintainer and it's been
> > updated to include Lua 5.0.2.
> >
> >   http://shootout.alioth.debian.org/
> 
> Well ... Lua has some trouble there, because:
> 
> - I guess they compiled Lua with the default settings, i.e. "-O" if we are
>   lucky. All other languages have some kind of configure script that sets
>   various compiler options to tune them to the max. Someone needs to
contact
>   the maintainer of the Lua Debian package. Since their policies on
compiler
>   flags are somewhat debatable, you may have a hard time.

>From http://ftp.debian.org/debian/pool/main/l/lua50/lua50_5.0.2-5.diff.gz :

-MYCFLAGS= -O2
+MYCFLAGS= -O3 -g

-O3 is a reasonable setting.  If you know of additional flags that provide
consistently better performance across the range of machines supported by
Debian, please send them to this list along with the benchmark data!

More likely the performance difference you see between the Debian
/usr/bin/lua50 and the one you built by hand is the result of the
performance penalty of shared libraries.  /usr/bin/lua50 doesn't contain the
Lua core; /usr/lib/liblua50.so.5.0 does.

The ease of upgradability of shared libraries has a cost.
Position-independent code is required for memory efficiency in SVR4 ELF
shared libraries.  It's larger. It tends to eat a register and i386 doesn't
have any to spare.  (x86_64 has more registers and an additional addressing
mode that reduces the PIC penalty.)  Dynamic linking has some additional
runtime overhead.

perl doesn't have this issue, as its core is statically linked into
/usr/bin/perl and therefore can be compiled without PIC.

> - Seems they accept now the use of external C libraries like NumPy to tune
>   some of the tests (e.g. matrix multiplication). This certainly moves the
>   scope of the shootout from 'language' to 'language + toolset'.

By the way, there seems to be a large penalty in the default scoreboard for
missing tests.  Zeroing the weight of the missing echo client/server test
puts Lua ahead of Perl.  (And then zeroing the weight of matrix multiply
puts Lua ahead of Python as well....)  Luasocket is in Debian, so somebody
should contribute an implementation.

Jay