[comp.lang.perl] Strange Results

yukngo@obelix.gaul.csd.uwo.ca (Cheung Yukngo) (08/04/90)

In article <8975@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:

. In article <1990Aug2.090725.2029@tc.fluke.COM> dcd@tc.fluke.COM (David Dyck) writes:
. : PS. (I came upon this while trying to convert the 'Lisp interpreter in Awk'
. :      that was posted to comp.lang.lisp and alt.sources into
. :      'Lisp in perl'.  After correcting the bug, perl was only a 
. :      little slower that awk).
. : 
. : 	AWK:  real    0m5.03s 	user    0m4.73s	 sys     0m0.11s
. : 	PERL: real    0m5.10s	user    0m4.78s	 sys     0m0.21s
.
. Hmm, not too bad for un-idiomatic Perl.  I bet it could be made to
. run twice as fast with a little perlish polish.
.
. Larry

I was very interested in the Lisp in Awk program so I converted it to
perl with the correction to the foreach loop. I then used
shift/unshift operations in perl to implement the stacks in the
program. Well, the program was more than twice as fast as the program
in awk, when I tested them on one of our Sun3 machines. (The run time
is totally unaccepted for the program to be useful.)


perl:       19.9 real        18.4 user         1.0 sys  
awk:        42.7 real        41.9 user         0.2 sys  

Then I copied the program to our MIPS machine. The original version
was still about 8% faster than the perl version. (Without the
improvement, it was 50% slower) 

perl:       real        2.7   user        2.5   sys         0.2
awk:        real        2.5   user        2.5   sys         0.0

I am a bit confused. Does MIPS have a super-awk?