View Single Post
Old 07-27-2004, 12:09 PM   #13 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 287
technobard is on a distinguished road
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.
technobard is offline   Reply With Quote