Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^6: The Most Essential Perl Development Tools Todayby topher (Scribe) |
on Jan 08, 2013 at 06:20 UTC ( [id://1012165]=note: print w/replies, xml ) | Need Help?? |
Your benchmark is rather bogus. The performance "hit" from the return statement is negligible. It's the prototype for no arguments with no return statement that gives a seeming big return (I'm guessing the interpreter is optimizing it to nearly a no-op).
Is there a performance gain from not using return in this spot? Yes. Is it a premature micro-optimization which is unlikely to have anything but a negligible impact the vast majority of real world code? Yes. Would I consider this performance gain an invalid reason to skip a return statement on any code that hasn't been profiled and clearly shown to benefit from this micro-optimization? Yes.
In Section
Seekers of Perl Wisdom
|
|