sort…

August 9, 2009 9:35 pm UTC | In Tech | 1 Comment | hide

I recently noticed CentOS 5.3′s sort is way slower than Ubuntu 9.04′s. Apparently the i18n patch used in coreutils-5.97 CentOS rpm is a performance killer:

$ LANG=C time -p sort --buffer-size=128M -n -k1 -k2 test.info > /dev/null
real 92.58
user 86.04
sys 6.52
$ time -p sort --buffer-size=128M -n -k1 -k2 test.info > /dev/null
real 463.04
user 456.01
sys 6.64

P.S. grep and other locale sensitive utilities have similar issue.

BTW, if your disk is slow, --buffer-size is a parameter you might want to play with to optimize performance. By default sort uses very conservative buffer size while your seemingly used memory is actually just used for cache. [ref]

Tags: , , ,

This weblog is licensed under a Creative Commons License.
Powered by WordPress. Theme based on Pool by Borja Fernandez.