Sorting Large File (Code/Performance)

Paul Rubin http
Fri Jan 25 20:50:17 CET 2008


Nicko <usenet at nicko.org> writes:
>     # The next line is order O(n) in the number of chunks
>     (line, fileindex) = min(mergechunks)

You should use the heapq module to make this operation O(log n) instead.



More information about the Python-list mailing list