Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Temp variable performace vs Inline behavior

by BrowserUk (Patriarch)
on Jun 27, 2012 at 15:25 UTC ( [id://978698]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Temp variable performace vs Inline behavior
in thread Temp variable performace vs Inline behavior

Calling parse_node() twice in order to avoid a temporary variable, is very unlikely to effect a performance gain.

Unless parse_node() does almost nothing, in which case you would certainly gain more by in-lining it code in the loop. The grep solution will almost certainly prove faster.

Either way, it probably isn't worth the effort unless this is likely to be called thousands or millions of times.

My philosophy is "Optimise if it is worth it!". And that means concentrating ones effort where gains are likely to be measurable -- in the overall runtime.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found