Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: A matter of sub pass by reference or copyby choroba (Cardinal) |
on Mar 13, 2021 at 20:29 UTC ( [id://11129590]=note: print w/replies, xml ) | Need Help?? |
The table tells us that the "copy" was able to run 171189 times per second, while the "ref 1" was able to run 5073751 times per second, i.e. 29 times faster. Note that in practice, if you need to access each element of the array, repeated dereferencing can be slower than accessing the elements directly.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|