http://www.perlmonks.org?node_id=1064331


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.