in reply to speed : obj vs func, by_name vs positional
Correct me if my micro benchmark are flawed.(i mean i know they are flawed if you look at the big picture, but in this micro way..).
Calling the tests themselves and doing the addition will add time, so the actual speed difference is (slightly?) higher than results imply.
Do you know some trick that we can use to speed up by_name passing ?Take a look at how POE does it. But really, the best way to optimize this stuff is to inline the subroutine/method calls or find some other way of doing the algorithm.
If that isn't enough, move to XS/C. If that isn't enough, inline the calls in C. :-) update: in my experience, when you're already doing XS/C you'll find out how much time perl sub/method calls really take. 99.5% of the time it won't matter a bit, but when speed is really important you'll just want to get rid of the calls all together.
|
|---|