
18 Jun
2008
18 Jun
'08
2:56 p.m.
Stefan O'Rear
Ok, strane ... Well, let's test with some 'normal' text:
time ./sort < bible > /dev/null # ~ 0.4 s time sort < bible > /dev/null # ~ 0.56 s
Ok, not that different. But with Haskell you often expect to get very slow code compared to an implementation in C.
GNU 'sort' uses an external sort algorithm. You can, with 200M of memory, give it a 50G input file, and it will work. This might explain the difference..
GNU sort also handles locale-based comparison, which I suspect explains more of the difference. Try with LC_ALL=C. -k -- If I haven't seen further, it is by standing in the footprints of giants