4 ms·
I recently did something similar and was surprised to see the python sort command be way faster than unix sort. The only thing is that you have to split it up
by xsltuser2010 16y ago
I recently did something similar and was surprised to see the python sort command be way faster than unix sort.
The only thing is that you have to split it up and merge after sorting (for which unix sort was ok enough).
Not sure why I got that result, but even with increased buffer size for unix sort it didnt much differ. I also didn't run the splitted sorts in parallel, which would of course have been a good idea.
- jerf 16y agoPython's sort algorithm is Timsort: http://en.wikipedia.org/wiki/Timsort http://en.wikipedia.org/wiki/Timsort You may have had a data set that tickled something that plays to Timsort's advantage; Timsort was basically designed to encounter that case as often as possible on real data.