Prev: interpreting a unix command I
Next: Finding the largest files in a filesystem (or highest values ina list) quickly
From: Dan Stromberg on 25 Jan 2010 14:21 I recently updated my "highest" program to optionally use a heap or treap, giving it a nice additional performance boost. http://stromberg.dnsalias.org/~dstromberg/highest/ It's a pretty common operation in shell scripts and *ix administration, so it seemed worth optimizing a bit beyond the traditional "sort -r | tail", especially now that filesystems now will often hold millions of files; as filesystems continue to grow, this optimization will likely gain in value (though GNU sort is pretty good if you throw enough physmem at it). I hope someone else finds it useful too. |