http://qs1969.pair.com?node_id=11134603


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.