Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.7.5
-
None
-
None
Description
DefaultGroovyMethods.unique has two inner loops, so its complexity is O(n^2)
Practically it means that it starts taking ages on collections with 1000 or more elements.
Simply adding elements to a linked hash set would get O(n*log n) performance.
Will develop my own unique implementation after New Year, and will attach it here
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-5337 Collection.unique() is O(n^2) time -- suggestion for improvement
- Closed
- is related to
-
GROOVY-4341 DefaultGroovyMethods#unique O(n²) performance
- Closed