in reply to When every microsecond counts: Parsing subroutine parameters
When every microsecond counts you factor out expensive stuff into XS code. Or don't use perl.
That said, constructing (and tearing down) a hash (which happens if you call foo( {bar => 'quux'} )) at every subroutine invocation is expensive, but calling a sub in the first place is probably more expensive (stack frame setup / enter / leave / unwind cycle).
--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}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: When every microsecond counts: Parsing subroutine parameters
by snowhare (Friar) on May 17, 2008 at 19:32 UTC | |
by Joost (Canon) on May 17, 2008 at 20:48 UTC |