Sorting Large File (Code/Performance)

Paul Rubin http
Fri Jan 25 14:50:17 EST 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