Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: log4perl and efficiency

by ForgotPasswordAgain (Deacon)
on Sep 12, 2011 at 22:20 UTC ( #925585=note: print w/ replies, xml ) Need Help??


in reply to Re^3: log4perl and efficiency
in thread log4perl and efficiency

Better yet, use a constant instead of a hashref lookup, and the whole if block will be obliterated at compile time when you disable debugging.

use constant DEBUG => 0; ... if (DEBUG) { # complex logging, which disappears from the op tree }

FWIW, my experience has been like Solo's, where you end up inadvertently evaluating the arguments to the logging methods, and this takes a lot of time (or a little bit of time in a tight loop that's called a zillion times).


Comment on Re^4: log4perl and efficiency
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2015-07-29 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (261 votes), past polls