I undef @arr_2_hash{@arr_2}; in sub hash_grep(), noting it was faster than the OP's original.
Changing this @diff3{@arr_1} = @arr_1; to @diff3{@arr_1} = () makes some difference.
No--it makes a huge difference and it, by far, blows everything else away. Will make that change in a new sub and re-benchmark. Glad you mentioned it!
In reply to Re^3: Best method to diff very large array efficiently
by Kenosis
in thread Best method to diff very large array efficiently
by newbieperlperson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |