Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Does the reference of a scalar more efficient than scalar?

by ccn (Vicar)
on Dec 11, 2008 at 09:24 UTC ( [id://729642]=note: print w/replies, xml ) Need Help??


in reply to Does the reference of a scalar more efficient than scalar?

As said in Perl Cookbook

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.

  • Comment on Re: Does the reference of a scalar more efficient than scalar?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://729642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found