Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by LanX (Saint)
on Jan 07, 2020 at 13:37 UTC ( [id://11111125]=note: print w/replies, xml ) Need Help??


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

> The point of the exercise is not to access lexical variables.

But you are measuring them too.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^6: "exists $hash{key}" is slower than "$hash{key}"

Replies are listed 'Best First'.
Re^7: "exists $hash{key}" is slower than "$hash{key}"
by swl (Parson) on Jan 08, 2020 at 23:50 UTC

    Yes, the lexical variables are part of the absolute timings.

    However, it's the relative timings that are of interest in this case as the point of the exercise was to assess the difference between exists $h{$k} or $h{$k}. If all other components are held constant then the timing differences should be due to the use of either of the two idioms (noting that the benchmarks need to be updated given dave_the_m's comments in 341121).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-25 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found