Many said that ArrayList.removeAll very slow with large arrays.
This article provides two optimized solutions for the speed of ArrayList.removeAll, but it requires their implementation in the class itself and cannot be used externally as a fix.
Is there a way to apply this type of fix that does not copy the source code of ArrayList and uses my own version?
Edit: I suppose I should add my need for this, since there is probably a way to do what I want without ArrayList.removeAll.
I have two lists around 70,000 longs each. They are almost identical, but in one list there are several more numbers that the second list does not have, and I want to find them. The only way to find them is to do first.removeAll(second) to find the difference. Is there another way?
java arraylist
Rick button
source share