Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: "exists $hash{key}" is slower than "$hash{key}"

by choroba (Cardinal)
on Jan 07, 2020 at 09:53 UTC ( [id://11111114]=note: print w/replies, xml ) Need Help??


in reply to Re^4: "exists $hash{key}" is slower than "$hash{key}"
in thread "exists $hash{key}" is slower than "$hash{key}"

> The Benchmark module is eventually running the code's text thru eval , but inside it's own scope.

Not only that, it also turns off strict, so Perl doesn't tell you the hash you're trying to access doesn't exist.

sub _doeval { no strict; eval shift }

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found