Newsgroups: comp.lang.lisp.x,comp.lang.lisp,comp.lang.perl,comp.lang.python,comp.lang.tcl
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!in1.uu.net!netlabs!lwall
From: lwall@netlabs.com (Larry Wall)
Subject: Re: C/Lisp/Python/Tcl - yet another performance comparision
Message-ID: <1996Jan25.003341.10185@netlabs.com>
Reply-To: lwall@sems.com
Organization: Seagate Enterprise Management Software, Cupertino, California.
References: <DMITRY.96Jan16220951@pavel.physics.sunysb.edu> <4dkdfo$muo@news1.panix.com> <1e20osfhr6.fsf@cipher.rtp.dg.com>
Distribution: inet
Date: Thu, 25 Jan 1996 00:33:41 GMT
Lines: 26
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp.x:1706 comp.lang.lisp:20594 comp.lang.python:8277 comp.lang.tcl:41542

In article <1e20osfhr6.fsf@cipher.rtp.dg.com>,
Lance A. Brown <labrown@dg-rtp.dg.com> wrote:
: Using the  '1..1000000'  method t construct an array in PERL is not
: optimal.  It is about as unoptimal as you can get.

Actually, it's about as optimal as you can get, given that you really
*do* want to construct an array.  But it's far from the optimal way to
write a loop, for sure.  This is documented.

By the way, just to fit in with everyone else, several weeks ago I also
wrote a version of the benchmark that runs about twice as fast for
Perl.  Mostly by using autoincrement where a Perl programmer would
typically use an autoincrement.  (Well, actually, I will admit to going
a step further and using autodecrement.)

I also agree with the poster who pointed out that it's not entirely
fair to compare a heavily optimizing C or C++ compiler with a
load-and-go compiler like Perl's or Python's (at least if you're going
to feed them untuned code).  The users of such languages are expected
to worry a little more about that sort of thing, if speed is what they
happen to be optimizing for at the moment.  Indeed, doing little tweaks
like that is part of what makes it fun to program in these languages.
C++ compilers rarely optimize for the joy of programming.

Larry Wall
lwall@sems.com
