| A quick update. I did some speed tests creating Vectors of Person objects of various sizes and sorting the Vectors using a traditional Comparator vs the generic StringComparator. The Un-Scientific Results: Up to about 10,000 objects, sort speed is fairly close between the two approaches. The traditional route is usually faster, but not always and not by much. Go above 10,000 objects and you see a roughly 10 - 12% overhead associated with the generic method. For example, I ran a sort of 100,000 objects:
-- Traditional ==> 4.0 secs
-- Generic ==> 4.5 secs
Repeated tests varied over a range, but were generally within 10 - 12%.
Your mileage may vary. |