Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^4: Using 'keys' on a list

by Anonymous Monk
on Jul 02, 2021 at 21:08 UTC ( #11134601=note: print w/replies, xml ) Need Help??

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

I don't think a benchmark makes much sense ... The effect and performance will be about the same.

there you go again making claims about performance when you haven't run the benchmarks

Replies are listed 'Best First'.
Re^5: Using 'keys' on a list
by Marshall (Canon) on Jul 02, 2021 at 22:05 UTC
    Ok, what would you have me benchmark? Why don't you do it yourself?

    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?

      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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2021-11-28 08:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found