Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: How does variable definition affect Perl performance ?

by ikegami (Patriarch)
on Dec 05, 2009 at 17:15 UTC ( [id://811256]=note: print w/replies, xml ) Need Help??


in reply to Re: How does variable definition affect Perl performance ?
in thread How does variable definition affect Perl performance ?

setting to 0 a variable containing huge data can maybe take time.

No. Why would assigning to a variable have to traverse the contained string? The length of the string contained doesn't matter. It's not even freed (which still wouldn't effect the time taken for long strings vs small strings).

Or maybe you are talking about a scalar that contains the last reference to an object or a large structure? Destroying the structure can take time (e.g. if destructors need to be called), but I don't see the relevance. Destroying the structure will have to occur sooner or later. It's not going to speed up the OP's program by delaying when it occurs.

  • Comment on Re^2: How does variable definition affect Perl performance ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found