Array::sort is a fast, easy way to sort arrays. Unfortunately, sometimes you want to test out different sorting algorithms, or feel that Array::sort doesn't use the optimal algorithm for your code. rSort will be a module that provides a set of methods to allow various sort algorithms to be applied to arrays of comparable objects. It will include as many algorithms as possible, considering its raison d'etre, including a half-dozen or so O(n2) algorithms, several O(n log n), and possible support for sort networks. In addition, it will include methods for timing sorts to allow easy comparison of performance, and have many options for output, from simple returns to full traces.

Why are you doing this? Array::sort works so well!

It does, doesn't it? It's fast, that's for sure! Why would anyone bother using anything else? 4 reasons:

  1. I don't want the knowledge of sorting techniques to be lost as a new generation of programmers grow up using languages that give them ready-made sort facilities.
  2. I feel it's important for developers to have as much choice as possible in all aspects of their code.
  3. Curiosity. Anyone who's had an introductory Comp-Sci course remembers the example of the Cray being beaten by a TRS-80 when the Cray used an inefficient algorithm and the TRS-80 did not. Since "interpreted" languages seem to have such a stigma attached to them for being "slow", I want to see what kind of performance we can get using different algorithms.
  4. Because I can. ;)

Project Info - rSort

Initial alpha release