in reply to Performance issues with subroutines/methods
Calling subroutines means, in perl, not only that some code segment in memory is jumped to, but the build up of copious data structures by which the perl engine can keep track of context, and the tear-down of those stackframes after exiting. There is some optimization going on under the hood, as with subs declared with the NULL prototype returning a scalar and not relying on dynamic data or calling other subs, in which case their result will be inlined. But apart from that, calling subs just involves the overhead of, precisely - calling subs :-)
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|