4 ms·
This is really interesting to me - I can't seem to reproduce this on a couple different platforms. In the past (and just now) I've definitely seen 100x differen
by cmurphycode 8y ago
This is really interesting to me - I can't seem to reproduce this on a couple different platforms. In the past (and just now) I've definitely seen 100x differences with LC_ALL=C, but you used that on both, I'm sure.
How large was the 10 million line file, and do you know whether sort was paging files to disk?
- ikeboy 8y agoAbout 300MB. I just tried to replicate using random data and failed, will look more later, mine is power-law distributed and might make a difference. Used these commands: cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 10000000 > text cat /dev/urandom | od -DAn |tr -s ' ' '\n' |head -10000000 | sed -e 's/$/\/9.0/'> num bc -l num > num2 (that's to create decimal numbers) paste -d, text num2 > textfirst paste -d, num2 text > numfirst time LC_ALL=c sort -n numfirst -r > output real 0m10.712s user 0m21.959s sys 0m1.644s time LC_ALL=C sort --field-separator=',' -k2 -n -r textfirst > output real 0m9.638s user 0m21.940s sys 0m1.293s