Re: How to optimise slow perl scripts?

2002-02-23 Thread Nicholas Clark
On Fri, Feb 22, 2002 at 09:20:56PM +, Chris Benson wrote: On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? /(\+44\s+|0)20\D[78]\d{3}\D\d{4}\b/ phone numbers, CC numbers, ... all

Re: How to optimise slow perl scripts?

2002-02-22 Thread David Cantrell
On Fri, Feb 22, 2002 at 09:20:56PM +, Chris Benson wrote: On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? phone numbers, CC numbers, ... all the time :-( Ahh, so *you're* the one who

Re: How to optimise slow perl scripts?

2002-02-22 Thread Chris Benson
On Fri, Feb 22, 2002 at 09:42:53PM +, David Cantrell wrote: On Fri, Feb 22, 2002 at 09:20:56PM +, Chris Benson wrote: On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? phone

Re: How to optimise slow perl scripts?

2002-02-22 Thread Mike Jarvis
On Fri, 2002-02-22 at 16:42, David Cantrell wrote: On Fri, Feb 22, 2002 at 09:20:56PM +, Chris Benson wrote: phone numbers, CC numbers, ... all the time :-( Ahh, so *you're* the one who rejects one of my credit cards* cos it has the wrong number of digits :-) In the US you can never

How to optimise slow perl scripts?

2002-02-19 Thread Nicholas Clark
I have a slow perl script that is currently annoying me. I have run it under Devel::DProf, and from that have already identified 2 places where it could be accelerated. [4.5% by replacing explicit loops with join ,, upack C*, $foo 7.5% by replacing recursion with a loop] However, I think I'm

Re: How to optimise slow perl scripts?

2002-02-19 Thread Jonathan Stowe
On Tue, 19 Feb 2002, Nicholas Clark wrote: I have a slow perl script that is currently annoying me. I have run it under Devel::DProf, and from that have already identified 2 places where it could be accelerated. [4.5% by replacing explicit loops with join ,, upack C*, $foo 7.5% by

Re: How to optimise slow perl scripts?

2002-02-19 Thread Nicholas Clark
On Tue, Feb 19, 2002 at 02:22:09PM +, Jonathan Stowe wrote: Build the Perl with the gcc option -pg and then run gprof, and then get jiggy in pp_hot.c ;-} Mmm. Not tried that. I did try using gcov a while back, and found that if I re-ordered the switch statement in rexexec the regression

Re: How to optimise slow perl scripts?

2002-02-19 Thread Paul Johnson
On Tue, Feb 19, 2002 at 01:05:29PM +, Nicholas Clark wrote: However, I think I'm at the limit of things I can learn from DProf. What other techniques can I use to figure out where and why it is slow? Devel::Cover now does time coverage, aka profiling. It's pretty basic and pretty new,

Re: How to optimise slow perl scripts?

2002-02-19 Thread Richard Clamp
On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: However perlbench went slower because I'd made /(.{1,76})/ slower (used in string/base64.t). How many people use {} in real regexps? IIRC There are almost none in any script used to build perl. I

Re: How to optimise slow perl scripts?

2002-02-19 Thread Paul Makepeace
On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? s/(.{1,72})(\s+|$)/$1\n /g; (Wordwrap for my sigs.) Paul -- Paul Makepeace ... http://paulm.com/ What is Clark Kent without a telephone booth? Another

Re: How to optimise slow perl scripts?

2002-02-19 Thread Nicholas. Clark
On Tue, Feb 19, 2002 at 10:05:36AM -0800, Paul Makepeace wrote: On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? s/(.{1,72})(\s+|$)/$1\n /g; (Wordwrap for my sigs.) D'oh! $definition =~ s/(.{74,77},)/$1\n/g; That bit of

Re: How to optimise slow perl scripts?

2002-02-19 Thread jo walsh
There must be easier ways than this :-) why don't you just throw hardware at the problem? :) z

Re: How to optimise slow perl scripts?

2002-02-19 Thread Tom Hukins
On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: How many people use {} in real regexps? IIRC There are almost none in any script used to build perl. I've used it quite often for validating input, for example to check the user entered a number containing x and y digits/letters.

Re: How to optimise slow perl scripts?

2002-02-19 Thread Nicholas Clark
On Tue, Feb 19, 2002 at 07:15:03PM +, jo walsh wrote: There must be easier ways than this :-) why don't you just throw hardware at the problem? :) Because there's this little label on it marked product warranty will be void if label on the top cover is removed or if the drive

Re: How to optimise slow perl scripts?

2002-02-19 Thread Jonathan Stowe
On Tue, 19 Feb 2002, Richard Clamp wrote: On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote: However perlbench went slower because I'd made /(.{1,76})/ slower (used in string/base64.t). How many people use {} in real regexps? IIRC There are

Re: How to optimise slow perl scripts?

2002-02-19 Thread Jonathan Stowe
On Tue, 19 Feb 2002, jo walsh wrote: There must be easier ways than this :-) why don't you just throw hardware at the problem? :) Yeah, lets hand out loads of kit to early adopters of Perl 5.8.0 :) /J\