A lot of people have said that ArrayList.removeAll
is really slow with large size arrays.
This article provides two optimized solutions to the ArrayList.removeAll speed, but requires implementing them in the class itself, and cannot be used externally as a fix.
Is there any way to apply this sort of fix short of copying the ArrayList source code and using my own version of it?
Edit: I suppose I should add my need for this, as there is probably a way to do what I want without ArrayList.removeAll.
I have two lists of around 70,000 longs
each. They are almost identical, but one list has a few more numbers that the second list doesn't have, and I want to find them. The only way I know to find them is to do first.removeAll(second)
to find the difference. Is there another way?