Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: '%hash = ()' is slower than 'undef %hash'

by afoken (Chancellor)
on May 18, 2018 at 17:35 UTC ( [id://1214869]=note: print w/replies, xml ) Need Help??


in reply to '%hash = ()' is slower than 'undef %hash'

%hash = () is slower than undef %hash about 1.2 times [...] What is your opinion?

It seems you are micro-optimizing. Unless %hash=() resp. undef %hash takes significant amounts of time (say a minute or more per run), I would simply ignore it. Very likely, other places of your code need much more time and optimizing them gains much more. Hint: Try Devel::NYTProf.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found