Array Returns

abez abez at abez.ca
Thu Jun 20 12:46:25 CDT 2002


http://groups.google.com/groups?q=perl+return+array&hl=en&lr=&ie=UTF8&oe=UTF8&selm=dwolfe.874517873%40talos4&rnum=1

In summary 
return @ret; is slower than
return \@ret;

>From the message:

Benchmark: timing 10000 iterations of 
Explicitly return a ref to an array, 
Explicitly return an array, 
Implicitly return a ref to an array, 
Implicitly return an array...

Explicitly return a ref to an array:  0 secs ( 0.30 usr  0.00 sys =  0.30
cpu)
            (warning: too few iterations for a reliable count)

Explicitly return an array: 38 secs (37.45 usr  0.00 sys = 37.45 cpu)

Implicitly return a ref to an array:  0 secs ( 0.24 usr  0.00 sys =  0.24
cpu)
            (warning: too few iterations for a reliable count)

Implicitly return an array: 38 secs (37.12 usr  0.00 sys = 37.12 cpu)



-- 
ABeZ------------ ------- ------ - ---------- -- ------------
http://www.indexdirect.com/abez/ Abram Hindle (abez at abez.ca)
---- ------- ----------- ----------- - - ------ --------ABeZ




More information about the Victoria-pm mailing list