summaryrefslogtreecommitdiff
path: root/common.h
Commit message (Collapse)AuthorAgeFilesLines
* Add debugging assertionBobby Bingham2014-10-291-0/+1
|
* Add instrumentationBobby Bingham2014-10-291-2/+1
| | | | | Track the number of comparisons, swaps, and rotations performed in each part of the sorting algorithm.
* Split helper functions into their own translation unitsBobby Bingham2014-10-261-88/+11
|
* Fix buffer distribution stepBobby Bingham2014-10-261-1/+1
| | | | If there are no sorted elements to distribute the buffer into, we're done.
* Use binary search in distribute bufferBobby Bingham2014-08-231-5/+2
|
* Optimize rotateBobby Bingham2014-08-181-15/+13
| | | | | | | | | | | | | | | Previously, we used three rotations. This was simple, but was aggressively inlined by gcc at higher optimization levels, massively bloating the code. Now, we take the front of the array, which is to be rotated to the end, and using a series of swaps, move it progressively closer to the end. When we can no longer perform a swap of the required size because we're too close to the end, we view the remaining operation as a rotate to the right with a smaller shift size. We repeat as necessary. This generates somewhat smaller code than the three reverses, even at -Os. It also shows up to a 25% overall performance improvement for grailsort on some inputs.
* Optimize swap for larger swapsBobby Bingham2014-07-311-0/+14
|
* Use linear search when distributing bufferBobby Bingham2014-07-311-4/+2
|
* Factor out binary_searchBobby Bingham2014-07-171-21/+2
|
* Vastly improve performance of distribute_bufferBobby Bingham2014-07-061-10/+11
|
* Move wikisort/grailsort common code to a shared headerBobby Bingham2014-07-061-0/+107