in reply to Re: Debug Macro
in thread Debug Macro
No this doesn't help. You're still paying the cost of a function call. And function calls are s-l-o-w in Perl.
I recently encountered a program of which 20% of the run time was being absorbed by a debug() that was being called to do nothing. (postgrey, in case you were wondering).
My solution was to change the code to
debug("foo") if DEBUG;... but only because I was worried about performance. From a readability point of view, it sucks.
True macros would be a nice addition to Perl. I know that there's a Macro module that purports to do just this, but I have never used it.
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Debug Macro
by Ovid (Cardinal) on Mar 27, 2007 at 13:17 UTC | |
|
Re^3: Debug Macro
by sgt (Deacon) on Mar 27, 2007 at 22:49 UTC | |
by grinder (Bishop) on Mar 28, 2007 at 06:58 UTC |