Reserving the right to change my mind if and when you post actual code, the simplest way of optimising your loop would (probably) be to in-line the bodies of the two functions in the loop.
Function call overhead is relatively high in Perl. If the function itself does very little--as appears to be the case from your description--then the overhead of setting up and tearing down the "stack frame" can be higher than that for the code inside. By in-lining the code, you avoid that overhead, and for small functions, there is little downside. Especially if this is the only place those subs are called.
In reply to Re: Some code optimization
by BrowserUk
in thread Some code optimization
by roibrodo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |