in reply to Timing of Array-Size Determination Methods
is my test doing a reasonable job of timing?
Nothing pops out at me.
Is scalar(@array) is slower because it requires a function call?
That would be my guess, yes. It has to build the entire @_ variable from your huge array input. That alone is going to slow it down.
But at the level of almost 2 million per second in the slowest case, I really wouldn't worry about it (:
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|