Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Best method to diff very large array efficiently

by BrowserUk (Pope)
on Nov 26, 2013 at 20:00 UTC ( #1064461=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Best method to diff very large array efficiently
in thread Best method to diff very large array efficiently

I avoided allocating useless arrays for the result

Your benchmark is completely unrealistic, chalk & cheese comparison, and thus totally broken.

  1. keys & values used in void context:>

    From perlfunc:

    • "In particular, calling keys() in void context resets the iterator with no other overhead."
    • "(In particular, calling values() in void context resets the iterator with no other overhead.)"
  2. Whilst grep in a void context probably avoid generating the return list; it doesn't stop it from iterating the entire input list.

Benchmark code that doesn't actually produce the required result is broken. And broken, is just broken; of no value at all.

Obviously vec scales badly the sparser the distribution of values become...

Think again.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^5: Best method to diff very large array efficiently
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-26 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls