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

Re^5: Using 'keys' on a list

by Marshall (Canon)
on Jul 02, 2021 at 22:05 UTC ( #11134603=note: print w/replies, xml ) Need Help??


in reply to Re^4: Using 'keys' on a list
in thread Using 'keys' on a list

Ok, what would you have me benchmark? Why don't you do it yourself?

Update:
If you need access to a complete hash, it is completely clear that returning a reference to a hash which has been created already is much more efficient than causing the hash to be re-created from a list. If you claim that is not true, then you need to provide some benchmarks yourself! That duck just doesn't fly.

I guess we are talking about returning ONLY the keys from a hash table, that which is created in a sub? Or what? The sub can make a list of those keys itself or it can pass a ref to its internal hash for the calling sub to do the same. That computational effort will be similar.

What are you talking about? What kind of benchmark do you propose?

Replies are listed 'Best First'.
Re^6: Using 'keys' on a list
by Anonymous Monk on Jul 02, 2021 at 22:26 UTC
    Why don't you do it yourself?

    uh, because *you're* the one making claims about performance without benchmarks...

      > uh, because you're the one making claims about performance without benchmarks...

      Nope, you started with claims of a benchmark...

      > > > > then your benchmark is very different from mine

      Ok you had your fun trolling.

      Now prove your "point" with code or go find another victim.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      You are the one claiming things that don't make sense.

      In general, passing a ref to a hash that has been created in a sub is much, much more efficient than passing the key/value pairs as a list to the caller. Period.

      The case presented by the OP is a bizarre thing.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2021-12-08 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (34 votes). Check out past polls.

    Notices?