Perl Monk, Perl Meditation | |
PerlMonks |
Re: Question about curious performance of if...elsif blockby sundialsvc4 (Abbot) |
on Jan 16, 2012 at 23:52 UTC ( [id://948228]=note: print w/replies, xml ) | Need Help?? |
One trick that might help here is to define an array (or a hash...) of subs; that is to say, of “code references.” Directly fetch and execute (if it exists) the specific subroutine that you want to execute. So you’re not performing 39 if-tests in a row in order to determine that you want to execute subroutine #40... I am not asserting that it will help in your particular, very rarified and performance-hungry case. Only empirical testing would establish that.
In Section
Seekers of Perl Wisdom
|
|