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

Re: [MacPerl] Is MacPerl 5.0.7r1m much slower than 4.1.8 or is it justme?



sdouglass@armltd.co.uk (scott douglass) writes:
>I was trying out the MPW tool version of MacPerl 5.0.7r1m and it seems much
>slower than 4.1.8.  For example:
>
>Date -n
>perl5.0.7r1m -e 'while (<>) { ++$includes{$1} if /^\s*#\s*include\s+(\S+)/
>} foreach $k (keys %includes) { print $k, "\t", $includes{$k}, "\n"; }'
>"{{CIncludes}}"=89
>Date -n
>
>['=89' is option-X]
>
>This takes about 30 seconds with MacPerl 4.1.8 on my PowerMac 8100/80.
>With 5.0.7r1m I waited a few minutes before I gave up and interrupted it.
>I'm using MPW Shell version 3.4.2b1c3 (which is probably later than ETO 19,
>sorry).

>Unexpectedly I was always in MacX even though it wasn't doing
>anything (not even any windows open).  After quitting MacX and all the
>other apps except the Finder 5.0.7r1m got much faster about the same as
>4.1.8.  Is the 5.0.7r1m MPW tool yielding way, way too frequently?

5.0.7r1m calls SpinCursor 12 times a second. I'm not quite sure into how
many WaitNextEvents this translates. It seems to me that MacX might be
stealing way, way too many cycles.

Performance of 4 vs. 5 depends on two factors:

 - How often WaitNextEvent is called. I can't find any code differences at
   first glance.
 - Whether stdio can cheat. Perl4 was compiled with MPW C, which has rather
   Unixish stdio libraries, while the Metrowerks library used in Perl5 
   has a very different implementation. Thus, so far, MacPerl5 variants have
   had to disable the stdio hacks built into Perl. 

However, these hacks now run, and measuring the above example, I found that
Perl5.0.7r1m took about 34 seconds, Perl4 also about 34 seconds, and perl5.002
took about 28-29 seconds. These times seem reasonable compared with MPW
Count and search, two of the fastest MPW tools, which take 23-24 seconds.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "The Deliverator used to make software. Still does, sometimes. But if
    life were a mellow elementary school run by well-meaning PhDs, the 
    Deliverator's report card would say: ``Hiro is *so* bright and creative
    but needs to work harder on his cooperation skills.''"
                               -- Neal Stephenson, _Snow Crash_