Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.2.0
-
None
Description
As noted in GROOVY-1986, the current version of this method is slow compared to Java's existing retainAll method for Sets, on the order of 4000% in test cases with a significant amount of data and intersections. The performance can't be improved due to limitations in the Java API.
This should be documented, as we would have never chosen intersect(..) if we were aware of the performance implications vs. convenience it provides.