Method private static List<Break> GetUniqueValues(string fieldName, DataTable table)
is very slow for large number of features. The problem is that it's complexity is O(N*N) as it linearly searches for repeated values for every feature. In my tests, a shapefile with about 280K features takes forever to complete.
My solution uses a Hashset instead of an ArrayList to store the unique values. As a result, searching for a repeating value is basically O(1) and the complexity of the whole method is reduced to O(N).
Attached is the fixed file. Original version is 1.8.
Comments: Thanks for this fix. It was added in [changeset 31ae152fd8a2](https://dotspatial.codeplex.com/SourceControl/changeset/31ae152fd8a2591678ae93d8e342ab7bb10af6bc).
is very slow for large number of features. The problem is that it's complexity is O(N*N) as it linearly searches for repeated values for every feature. In my tests, a shapefile with about 280K features takes forever to complete.
My solution uses a Hashset instead of an ArrayList to store the unique values. As a result, searching for a repeating value is basically O(1) and the complexity of the whole method is reduced to O(N).
Attached is the fixed file. Original version is 1.8.
Comments: Thanks for this fix. It was added in [changeset 31ae152fd8a2](https://dotspatial.codeplex.com/SourceControl/changeset/31ae152fd8a2591678ae93d8e342ab7bb10af6bc).