Re: [Gllug-Social] [ANNOUNCE] London.pm social, Knights Templar WC2, Thu 5 Mar 2009

2009-03-02 Thread ampers
Is this for Linux. Swine, or just for the perls? (Linux Users or Perl programmers)

is this thing on?

2009-03-02 Thread Martin A. Brooks
Nothing since 27/02.

Re: is this thing on?

2009-03-02 Thread Nigel Peck
Martin A. Brooks wrote: Nothing since 27/02. Seems to be working fine, guess everyone's had a busy weekend :)

Optimisation

2009-03-02 Thread Nigel Peck
When the list could be empty, which is faster? if ( @list ) { foreach ( @list ) { } } - or just - foreach ( @list ) { } Or is it a pointless question? Cheers, Nigel

Re: Optimisation

2009-03-02 Thread Andy Armstrong
On 2 Mar 2009, at 21:01, Nigel Peck wrote: When the list could be empty, which is faster? if ( @list ) { foreach ( @list ) { } } - or just - foreach ( @list ) { } Or is it a pointless question? Yes :) Benchmark it - but I bet there's not much difference - and the second version will be

Re: Optimisation

2009-03-02 Thread Andy Armstrong
On 2 Mar 2009, at 21:11, Andy Armstrong wrote: Or is it a pointless question? Yes :) Benchmark it - but I bet there's not much difference - and the second version will be faster in the non-empty case. Oooh: $ cat bm-foolish-idea.pl #!/usr/bin/env perl use strict; use warnings; use Benc

Re: Optimisation

2009-03-02 Thread Simon Wistow
On Mon, Mar 02, 2009 at 09:11:29PM +, Andy Armstrong said: > Benchmark it - but I bet there's not much difference - and the second > version will be faster in the non-empty case. With 1,000,000 iterations Rate no_ifif no_if 501961/s-- -2% if514056/s2%-- With

Re: Optimisation

2009-03-02 Thread Nigel Peck
Andy Armstrong wrote: Or is it a pointless question? Yes :) Thought as much :) Benchmark it - but I bet there's not much difference - and the second version will be faster in the non-empty case. Thanks, that puts this one to bed then :)

Re: Optimisation

2009-03-02 Thread Nigel Peck
Andy Armstrong wrote: $ perl bm-foolish-idea.pl Rateempty_foreach empty_if_foreach empty_foreach 5242880/s -- -74% empty_if_foreach 20309304/s 287% -- Rate non_empty_if_foreachnon_empt

Re: Optimisation

2009-03-02 Thread Kent Fredric
On Tue, Mar 3, 2009 at 11:02 AM, Nigel Peck wrote: > > > Sorry for the noob questions, but if these are being compared against each > other, why are the percentages different? > > Basic Math. 50 vs 60 = 50/60 and 60/50 . 50 / 60 = 0.83 and 60/50 = 1.2 1456355 / 1203020 1.2105825339 = 21

Re: Optimisation

2009-03-02 Thread Nigel Peck
Kent Fredric wrote: Basic Math. etc.. Thanks :)

Re: Optimisation

2009-03-02 Thread Andy Armstrong
On 2 Mar 2009, at 22:02, Nigel Peck wrote: Andy Armstrong wrote: $ perl bm-foolish-idea.pl Rateempty_foreach empty_if_foreach empty_foreach 5242880/s -- -74% empty_if_foreach 20309304/s 287% --