lua-users home
lua-l archive

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

2000-09-26-06:12:07 John Batty:
> I have seen quite a few performance comparisions of Lua vs other
> scripting languages, but has anyone done corresponding C/C++
> benchmarks?

I personally think that the less comparable two languages, the less
meaningful benchmark comparisons are. C (and C-with-warts, AKA C++)
are so far from all the scripting languages that it's really
impractical to try and make comparables. A figure I've often heard
bandied about is 10-1 between scripting langs and C. Folks doing
numerical work sometimes cite 100-1 ratios. When Kernighan and Pike
did an example program it ended up coming out something better than
10 times faster in C, but the C++ version was about as slow as Perl
--- but as long as the C version.

The thing I like about the benchmark I just did was that the
expressions of the desired functionality in each language were
pretty typical for each language, not much arcana, and the
expressions were very very comparable. Of course the follow-on
tweaks that bought another big speedup for Lua reveal that expert
programmers in each of the languages may be able to do
substantially better.

The conclusion I carried away from my comparison is that perl -n-
ruby are about the same, the performance difference there is a wash;
Lua is faster by at least a factor of two.


Attachment: pgp3lSzfaCRPJ.pgp
Description: PGP signature