Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064331]
help
Chatterbox?
[Corion]: Hmmm - I thought we'd made the textarea CSS-sized to 100% a long time ago?!
[Corion]: ... nope, it isn't
[LanX]: heh ... 11.78 popes per square mile ...never thought I might find miles handy
[ambrus]: TCLion: it's to make people write non-short writeups in an external editor and save it to a local file. otherwise people will complain that they had a very insightful extended reply but their browser died just when they were almost ready posting it.
[ww]: ++ambrus "their browser died just when...."
[ambrus]: ww: or they accidentally closed the window, or something. the exact excuse doesn't matter.
[ambrus]: you hear that on web forums frequently.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2017-03-23 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (292 votes). Check out past polls.