]> git.lizzy.rs Git - rust.git/commit
Implement a faster sort algorithm
authorStjepan Glavina <stjepang@gmail.com>
Tue, 6 Dec 2016 11:05:16 +0000 (12:05 +0100)
committerStjepan Glavina <stjepang@gmail.com>
Wed, 7 Dec 2016 20:35:07 +0000 (21:35 +0100)
commitc8d73ea68a9fbd127d7b78b4c167f0b80523ab7b
tree15bb048476a909f016cf39ed24da9385628f1e8d
parentff261d3a6b5964e1e3744d055238de624afc5d76
Implement a faster sort algorithm

This is a complete rewrite of the standard sort algorithm. The new algorithm
is a simplified variant of TimSort. In summary, the changes are:

* Improved performance, especially on partially sorted inputs.
* Performs less comparisons on both random and partially sorted inputs.
* Decreased the size of temporary memory: the new sort allocates 4x less.
src/libcollections/lib.rs
src/libcollections/slice.rs
src/libcollectionstest/slice.rs
src/test/run-pass/vector-sort-panic-safe.rs