Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Optimize my foreach loop / code

by Anonymous Monk
on Aug 20, 2016 at 03:56 UTC ( [id://1170108]=note: print w/replies, xml ) Need Help??


in reply to Optimize my foreach loop / code

Hi, how fast does this run you

sub ff{print scalar gmtime, "\n"; } ff; @g=(1..35_000); for(@g){ /(\d+)/ and $ff{$1}=$1; /(\d+?)/ and $ff{$1}=$1; /(\d+)/ and $ff{$1}=$1; /(\d+?)/ and $ff{$1}=$1; } ff; __END__

Replies are listed 'Best First'.
Re^2: Optimize my foreach loop / code
by rmocster (Novice) on Aug 25, 2016 at 20:31 UTC

    Less than 1 second.

    Thu Aug 25 20:29:05 2016
    Thu Aug 25 20:29:06 2016

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found