Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Number functions.. primes (ugly code runs faster)

by jdporter (Paladin)
on May 08, 2015 at 15:36 UTC ( [id://1126110]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Number functions.. primes (ugly code runs faster)
in thread Number functions I have lying around

I'd be curious to know whether you could get a slight bump in performance by replacing

if($i%2==0){next}

(etc.) with

$i%2 or next;

Perhaps naively, I think you would, since you'd eliminate (1) a lexical scope, with all of its setup and teardown; and (2) a numeric comparison.

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found