in reply to Does the reference of a scalar more efficient than scalar?
Using references, you can efficiently pass large amounts of data to and from a subroutine.
However, passing references to scalars typically turns out not to be an optimization at all.
Yes, several megabytes contained in the returned value is a good reason to use references. Your benchmark proves it. However if the length of returned scalar is not big than you get valuable overhead on dereferencing.
|
|---|