eduardo has asked for the wisdom of the Perl Monks concerning the following question:
if the code inside my_sub operates faster than the my_sub call itself, it's kind of stupid to keep it in a sub, i agree. but let us say that for reasons of software engineering and particular specifications, it is neccessary to keep that little piece of trivial code, in a sub (or a sub reference) is there a way to tell the perl interpreter to either: a) inline the sub (i know, evil C++ thing, it works!) or b) speed it up some OTHER way?sub my_sub($) { ... do something EASY and fast ... } foreach my $i (0 .... $a_bazillion) { my_sub($some_value); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: method inlineing
by mikfire (Deacon) on May 26, 2000 at 23:20 UTC | |
|
RE: method inlineing
by Shendal (Hermit) on May 26, 2000 at 23:05 UTC | |
|
Re: method inlineing
by jjhorner (Hermit) on May 26, 2000 at 22:49 UTC |