In article <4002C471.1070507 / zara.6.isreserved.com>,
David Garamond  <lists / zara.6.isreserved.com> wrote:
: Emmanuel Touzery wrote:
: > i have the feeling (unconfirmed) that perl is optimising it away since 
: > the result is unused or the operation repeated or something. i created a 
: > file with 1000000 lines repeating the addition and perl is very slow too 
: > then (and ruby too).
: 
: do you mean you did:
: 
: #!/usr/bin/{perl,ruby}
: 1234567+123456;
: 1234567+123456;
: 1234567+123456;
: 1234567+123456;
: 1234567+123456;
: ..
: 
: ?
: 
: then have you factored out compilation overhead? I would wild-guess that 
: Perl is slightly slower than Ruby, due to its complex syntaxes?

Nope.

:) [~] head -2 foo
1073741823+1073741824;
1073741823+1073741824;
:) [~] wc -l foo
 100000 foo
:) [~] time perl foo
perl foo  1.37s user 0.06s system 99% cpu 1.431 total
:) [~] time python foo
python foo  2.55s user 0.22s system 100% cpu 2.769 total
:) [~] time ruby foo
ruby foo  3.03s user 0.10s system 98% cpu 3.165 total

Still, that's not a difference which I'm overly worried about.

--Dave