Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by afoken (Abbot)
on May 18, 2018 at 17:35 UTC ( #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
Node Status?
node history
Node Type: note [id://1214869]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2019-04-25 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (127 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!