On Tue, 27 Mar 2001, Simon Wilcox wrote:
> At 16:53 27/03/2001 +0100, Robin Houston wrote:
> >On Tue, Mar 27, 2001 at 05:40:19PM +0200, Philip Newton wrote:
> > > Well, remember that the sub effecticaly recalculates (what amounts to) the
> > > array each time. To be fair, you should include the ar
On Tue, 27 Mar 2001, Simon Wilcox wrote:
> At 13:29 27/03/2001 +, Matthew Byng-Maddick wrote:
> So - Did I get this heinously wrong or is MBM's sub really a lot slower ?
You didn't get it wrong. It's a lot slower partly *because* it's a sub
rather than an array.
MBM
--
Matthew Byng-Maddick
At 16:53 27/03/2001 +0100, Robin Houston wrote:
>On Tue, Mar 27, 2001 at 05:40:19PM +0200, Philip Newton wrote:
> > Well, remember that the sub effecticaly recalculates (what amounts to) the
> > array each time. To be fair, you should include the array initialisation
> > inside the loop and see wh
At 16:48 27/03/2001 +0100, Simon Wilcox wrote:
>Benchmark: timing 10 iterations of Array, Sub, myArray...
> Array: 3 wallclock secs ( 3.37 usr + 0.05 sys = 3.42 CPU)
>Sub: 6 wallclock secs ( 5.30 usr + 0.08 sys = 5.38 CPU)
>myArray: 8 wallclock secs ( 8.39 usr + 0.11
On Tue, Mar 27, 2001 at 05:40:19PM +0200, Philip Newton wrote:
> Well, remember that the sub effecticaly recalculates (what amounts to) the
> array each time. To be fair, you should include the array initialisation
> inside the loop and see who wins then.
Hey, that's not _fair_!
The whole point o
At 17:40 27/03/2001 +0200, Philip Newton wrote:
>Simon Wilcox wrote:
> > So - Did I get this heinously wrong or is MBM's sub really a
> > lot slower ?
>
>Well, remember that the sub effecticaly recalculates (what amounts to) the
>array each time. To be fair, you should include the array initialisa
On Tue, Mar 27, 2001 at 04:19:08PM +0100, Simon Wilcox wrote:
> I thought I would play around with Benchmark.pm, because I don't use it
> nearly often enough, so I made this script:
>
> @th=(qw(th st nd rd),("th")x16)x2; $th[31]="st";
> sub th{(($_[0]-10-$_[0]%10)/10%10)?(qw(th st nd rd),('th')
Simon Wilcox wrote:
> So - Did I get this heinously wrong or is MBM's sub really a
> lot slower ?
Well, remember that the sub effecticaly recalculates (what amounts to) the
array each time. To be fair, you should include the array initialisation
inside the loop and see who wins then.
Cheers,
Ph