In article <1f2dnfpbhy54embmnz2dnuvz_osdn...@westnet.com.au>, Neil Hodgson <nhodg...@iinet.net.au> wrote:
> Roy Smith: > > > On the other hand, how long did it take you to do the directory tree > > walk required to find those million paths? I'll bet a long longer than > > 0.78 seconds, so this gets lost in the noise. > > About 2 minutes. But that's just getting an example data set. Other > data sets may be loaded more quickly from databases or files or be > created by processing. Reading the example data from a file takes around > the same time as sorting. Fair enough. In fact, given that reading the file from disk is O(n) and sorting it is O(n log n), at some point, the sort will totally swamp the input time. Your original example just happened to be one of the unusual cases where the sort time is not the rate limiting factor in the overall process. I remember reading somewhere that more CPU cycles in the entire history of computing have been spend doing sorting than anything else. -- http://mail.python.org/mailman/listinfo/python-list