lua-users home
lua-l archive

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

Bennett Todd wrote:

> I've not yet done anything substantial with Ruby, but I'd say the
> performance issue depends radically on what you're doing. For

As with any language...

> general purpose code flow, the kind of stuff I mostly do in
> scripting langs, it seems to be a bit slower than perl; haven't
> compared the I/O. I'd expect it'd only rarely be faster than Lua and

If you're talking about string manip, maybe... that's what perl was designed
for.  Everything else is sorta hacked into the interpreter.  Not in the most
efficient way, either, I might add.

> only approach the speed of Lua if the job you wanted to do happened
> to spend most of the compute time in C primitives that are better
> implemented in Ruby. So, if you wanna make Ruby shine, do arithmetic
> that uses gigantic numbers, that's wondrous quick in Ruby. But for
> most jobs it's gonna be way slower. And it's way way bigger:

I haven't timed Lua and Ruby against each other for common operations, but
I've seen results in various "Language Comparison Papers" around the web, and
Ruby takes the lead in most of them.  I'm interested in what benchmark
programs you used?

> ; ls -l /usr/bin/ruby /usr/bin/perl /usr/bin/lua
> -rwxr-xr-x    1 root     root        70464 Apr 25 12:57 /usr/bin/lua
> -rwxr-xr-x    2 root     root       527856 Feb  2  2000 /usr/bin/perl
> -rwxr-xr-x    1 root     root      1332418 Sep 19 14:59 /usr/bin/ruby
> ;

[stm@sean /usr/bin]$ ls -l perl5.6.0 ruby
-rwxr-xr-x    1 root     root       740656 Aug  7 14:52 perl5.6.0
-rwxr-xr-x    1 root     root       529372 Sep 19 06:08 ruby
[stm@sean /usr/local/bin]$ ls -l lua
-rwxr-xr-x    1 root     root        86232 Sep 25 18:19 lua

Again, no idea how you got your numbers there... perhaps you compiled your
own Ruby, and either did a debug build or didn't strip the binary?  I
installed both of these through the Mandrake Cooker RPMs (I'm running Linux
Mandrake 7.1).

Lua certainly does win in size, though, I'll admit that.  I'm going to
benchmark Ruby and Lua as soon as I get the free-time (I have to leave for
class in 10 min.).

And yes, that is Perl 5.6.0 (I've only seen those versions numbers under
Mandrake....).  Ruby is version 1.6.

> There's only one interpreted language that I've heard claimed can be
> faster than Lua regularly, that's qscheme.

Ah, yes, that one is insanely fast too... Too bad scheme isn't the most
newbie friendly language, or it'd be great for games (most games scripting
need to be done by non-programmers, or perhaps the user-community mod

Sean Middleditch

> -Bennett
>   ------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature