in reply to Re: Re: Re: Re: to strict or not to strict
in thread to strict or not to strict

...machine is about 20x quicker than mine :-)

The machine that ran on was a 1.4GHz Athlon, with IDE disks. Out of interest I ran it on one of the devel servers (Quad PIII Xeon 2GHz, RAID 5 SCSI really fast disks) Of course you only get to use one processor but there was a negligible performance difference.

[root@devel3 root]# perl test.pl Benchmark: timing 10000000 iterations of with, without... with: 9 wallclock secs ( 8.64 usr + 0.00 sys = 8.64 CPU) @ 11 +57407.41/s (n=10000000) without: 4 wallclock secs ( 4.05 usr + 0.00 sys = 4.05 CPU) @ 24 +69135.80/s (n=10000000) Rate with without with 1157407/s -- -53% without 2469136/s 113% --

What did you run it on out of interest?

On the Benchmark side the BEGIN case have identical (and much faster results) because Perl only executes them once and then effectively does a NOP on that code section. At least that is what I suspect....

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: to strict or not to strict
by BrowserUk (Patriarch) on Oct 17, 2003 at 14:54 UTC
    What did you run it on out of interest?

    233MHz P-II.

    On the Benchmark side the BEGIN case have identical (and much faster results) because Perl only executes them once and then effectively does a NOP on that code section. At least that is what I suspect....

    Given that the BEGIN{}s are wrapped in strings, the won't actually be seen by the compiler until eval time, which would mean that they are re-compiled each time the benchmark is iterated. Unless Benchmark wraps string code arguements in a subroutine wrapper and takes a coderef to the compiled code and invokes it via that for the second and subsequent runs, which is a possibility. I'll try to confirm or deny that.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!