Debian Codegraph @

README.md

raw symbols SCIP
1 A modified merge sort that's faster on almost-sorted data
2 =========================================================
3
4 This is an implementation of TimSort, the default sorting algorithm used in
5 Python and newer versions of Java.
6
7 [Full documentation here.](https://www.notriddle.com/rustdoc/timsort/)
8
9 [![Build Status](https://travis-ci.org/notriddle/rust-timsort.svg)](https://travis-ci.org/notriddle/rust-timsort)
10
11
12 Performance
13 -----------
14
15 This is still an extreme work-in-progress, and performance has vast room for
16 improvement.
17
18 The benchmarks are the only part that doesn't work in pure stable rust.
19 `benches/bench.rs` is for rust-TimSort, `benches/bench_default.rs` is for the
20 default MergeSort that comes with Rust.
21
22 ```
23 Running target/release/bench-dae501bb89de0c02
24
25 running 16 tests
26 test sort_big_random_large ... bench: 3,310,775 ns/iter (+/- 232,896) = 96
27 MB/s
28 test sort_big_random_medium ... bench: 7,755 ns/iter (+/- 118) = 412 MB/s
29 test sort_big_random_small ... bench: 297 ns/iter (+/- 19) = 538 MB/s
30 test sort_big_sorted ... bench: 18,038 ns/iter (+/- 251) = 17740
31 MB/s
32 test sort_equals ... bench: 1,342 ns/iter (+/- 93) = 5961 MB/s
33 test sort_few_unique ... bench: 66,582 ns/iter (+/- 1,882) = 60
34 MB/s
35 test sort_huge ... bench: 137,064,148 ns/iter (+/- 2,159,033) = 5
36 MB/s
37 test sort_partially_sorted ... bench: 1,488,792 ns/iter (+/- 19,015) = 53
38 MB/s
39 test sort_random_large ... bench: 2,010,436 ns/iter (+/- 92,632) = 39
40 MB/s
41 test sort_random_medium ... bench: 4,134 ns/iter (+/- 39) = 193 MB/s
42 test sort_random_small ... bench: 194 ns/iter (+/- 163) = 206 MB/s
43 test sort_sorted ... bench: 13,043 ns/iter (+/- 540) = 6133
44 MB/s
45 test sort_strings ... bench: 11,845,502 ns/iter (+/- 247,501) = 24
46 MB/s
47 test sort_tiny_random_large ... bench: 2,049,110 ns/iter (+/- 12,357) = 4
48 MB/s
49 test sort_tiny_random_medium ... bench: 4,227 ns/iter (+/- 98) = 23 MB/s
50 test sort_tiny_random_small ... bench: 166 ns/iter (+/- 4) = 30 MB/s
51
52 test result: ok. 0 passed; 0 failed; 0 ignored; 16 measured
53
54 Running target/release/bench_default-a77273e7b72e7094
55
56 running 16 tests
57 test sort_big_random_large ... bench: 1,383,147 ns/iter (+/- 31,362) = 231
58 MB/s
59 test sort_big_random_medium ... bench: 7,107 ns/iter (+/- 162) = 450 MB/s
60 test sort_big_random_small ... bench: 288 ns/iter (+/- 8) = 555 MB/s
61 test sort_big_sorted ... bench: 464,047 ns/iter (+/- 7,236) = 689
62 MB/s
63 test sort_equals ... bench: 15,959 ns/iter (+/- 949) = 501 MB/s
64 test sort_few_unique ... bench: 66,069 ns/iter (+/- 2,187) = 60
65 MB/s
66 test sort_huge ... bench: 9,503,439 ns/iter (+/- 377,908) = 84
67 MB/s
68 test sort_partially_sorted ... bench: 501,055 ns/iter (+/- 7,756) = 159
69 MB/s
70 test sort_random_large ... bench: 668,164 ns/iter (+/- 23,727) = 119
71 MB/s
72 test sort_random_medium ... bench: 3,685 ns/iter (+/- 35) = 217 MB/s
73 test sort_random_small ... bench: 187 ns/iter (+/- 15) = 213 MB/s
74 test sort_sorted ... bench: 266,431 ns/iter (+/- 7,553) = 300
75 MB/s
76 test sort_strings ... bench: 2,299,735 ns/iter (+/- 58,825) = 127
77 MB/s
78 test sort_tiny_random_large ... bench: 737,314 ns/iter (+/- 18,718) = 13
79 MB/s
80 test sort_tiny_random_medium ... bench: 4,141 ns/iter (+/- 45) = 24 MB/s
81 test sort_tiny_random_small ... bench: 160 ns/iter (+/- 11) = 31 MB/s
82
83 test result: ok. 0 passed; 0 failed; 0 ignored; 16 measured
84 ```
85
86
87 License
88 ------
89
90 Licensed under either of these:
91
92 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
93 http://www.apache.org/licenses/LICENSE-2.0)
94 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
95 http://opensource.org/licenses/MIT)