3 ms·
2x is only for integers, of course. Often you'll have bigger structs to sort. But anyway. If performance matters (it mostly doesn't; sorting is usually not a b
by jstimpfle 7y ago
2x is only for integers, of course. Often you'll have bigger structs to sort.
But anyway. If performance matters (it mostly doesn't; sorting is usually not a bottleneck), you can reap much more than 2x by various tricks
- Improve the data by adding easier to compare fields
- tailor sorting algorithm to the data (what machine types? can we optimize with CPU-specific assembly? Can we do radix sort?, etc)
- avoid the need for sorting altogether. Often, the data can be constructed in a better way such that it falls out sorted.