Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by Kenosis (Priest)
on Nov 25, 2013 at 23:00 UTC ( #1064331=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

Well I think it depends on the testcase...

Indeed, I think you're correct. And since the OP had some very specific specs, the qualified language "based upon benchmarking for this task" was used when characterizing the benchmarking results.

It was surprising to see how 'slow' Set::Scalar was, in this case. It may, in part, have to do with it maintaining the object-accessible universe of numbers from which the diff is calculated -- also accessed via the returned object.


update

Yes, undef @diff3{@arr_1} makes the OP's original solution faster than using @diff3{@arr_1} = (). Have updated the benchmarking. Thank you, again.


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-09-19 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (144 votes), past polls