1[/=========================================================================== 2 Copyright (c) 2017 Steven Ross, Francisco Tapia, Orson Peters 3 4 5 Distributed under the Boost Software License, Version 1.0 6 See accompanying file LICENSE_1_0.txt or copy at 7 http://www.boost.org/LICENSE_1_0.txt 8=============================================================================/] 9 10[section:linux_single 2.5.- Linux Benchmarks] 11 12 13This library contains a benchmark folder with programs to measure the speed of the algorithms on your machine and operating system. 14These are short benchmarks to test speed with different kinds of data ( random, sorted, sorted plus unsorted append at end ...) 15 16This was run on a Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz, with 6 cores and 2 threads by core, and 15M of cache 17 18The results obtained with GCC 6.3 on Linux, in the benchmark_numbers with integers are: 19 20[section:near_sorted Near Sorted Data] 21[: 22[h4[_Near Sorted Data With 100 000 000 64 bits Integers]] 23 24benchmark/single/benchmark_numbers.cpp : This benchmark shows the results obtained with several kind of integers numbers (random, and near 25sorted). 26 27The benchmarks with strings and objects of different sizes are not showed here, but you can obtain running the benchmark_strings.cpp ans benchmarks_objects.cpp programs. 28 29 30[*[teletype] 31`` 32 | | | | | | | 33 | | |std:: | |flat_ | | 34 | std::sort | pdqsort |stable_sort| spinsort |stable_sort|spreadsort | 35 ----------------------------+-----------+-----------+-----------+-----------+-----------+-----------+ 36 random | 8.21 | 3.99 | 8.62 | 9.73 | 10.80 | 4.26 | 37 | | | | | | | 38 sorted | 1.84 | 0.13 | 4.88 | 0.06 | 0.07 | 0.06 | 39 sorted + 0.1% end | 6.41 | 2.91 | 4.92 | 0.41 | 0.36 | 3.16 | 40 sorted + 1% end | 14.15 | 3.39 | 4.97 | 0.55 | 0.49 | 3.65 | 41 sorted + 10% end | 6.72 | 4.15 | 5.73 | 1.32 | 1.40 | 4.39 | 42 | | | | | | | 43 sorted + 0.1% middle | 4.41 | 3.31 | 6.58 | 1.89 | 2.61 | 3.29 | 44 sorted + 1% middle | 4.39 | 3.62 | 7.06 | 2.12 | 3.07 | 3.80 | 45 sorted + 10% middle | 6.35 | 4.71 | 9.56 | 4.02 | 5.49 | 4.99 | 46 | | | | | | | 47 reverse sorted | 1.36 | 0.26 | 5.12 | 0.13 | 0.14 | 1.87 | 48 reverse sorted + 0.1% end | 7.57 | 2.92 | 5.22 | 0.52 | 0.42 | 2.83 | 49 reverse sorted + 1% end | 4.99 | 3.33 | 5.29 | 0.66 | 0.55 | 3.45 | 50 reverse sorted + 10% end | 4.62 | 4.16 | 6.03 | 1.45 | 1.44 | 4.35 | 51 | | | | | | | 52 reverse sorted + 0.1% middle| 4.38 | 3.29 | 6.52 | 1.89 | 2.54 | 3.28 | 53 reverse sorted + 1% middle| 4.43 | 3.65 | 7.09 | 2.12 | 3.09 | 3.81 | 54 reverse sorted + 10% middle| 6.42 | 4.70 | 9.46 | 4.02 | 5.53 | 5.00 | 55 | | | | | | | 56 57`` 58] 59] 60[endsect] 61 62[section:complex_benchmarks Complex (Several Types)] 63[: 64The next results are obtained from more complex benchmarks, not include in the library because they use non free software 65(If you are interested in their code, contact fjtapia@gmail.com) 66 67There are 3 types of benchmarks, 68[: 69*64 bits integers 70 71*strings 72 73*objects of several sizes. 74 75The objects are arrays of integers. The heavy comparison sums all the elements in each, and the light comparison uses only the first number of the array. 76 77] 78 79 80 81[h4[_100 000 000 Numbers of 64 bits Randomly Filled]] 82 83 84[*[teletype] 85`` 86 | | | 87 | Time | Maximum | 88 | secs | Memory Used | 89 --------------------+---------+-------------+ 90 std::sort | 8.2154 | 784 MB | 91 pdqsort | 3.9356 | 784 MB | 92 | | | 93 std::stable_sort | 8.5016 | 1176 MB | 94 spinsort | 9.4262 | 1175 MB | 95 flat_stable_sort | 10.6790 | 788 MB | 96 spreadsort | 4.2248 | 785 MB | 97 | | | 98 99`` 100] 101[h4[_10 000 000 Strings Randomly Filled]] 102 103[*[teletype] 104`` 105 | | | 106 | Time | Maximum | 107 | secs | Memory Used | 108 --------------------+---------+-------------+ 109 std::sort | 6.2442 | 822 MB | 110 pdqsort | 6.6661 | 821 MB | 111 | | | 112 std::stable_sort | 12.2620 | 1134 MB | 113 spinsort | 8.5996 | 978 MB | 114 flat_stable_sort | 9.2559 | 978 MB | 115 spreadsort | 2.4323 | 822 MB | 116 | | | 117`` 118] 119[h4[_Objects Randomly Filled]] 120[: 121The objects are arrays of 64 bits numbers 122 123They are compared in two ways : 124[: 125 (H) Heavy : The comparison is the sum of all the numbers of the array. 126 127 (L) Light : The comparison is using only the first element of the array, 128 as a key 129] 130] 131 132[*[teletype] 133`` 134 | | | | | | | | 135 | 100000000 | 50000000 | 25000000 | 12500000 | 6250000 | 1562500 | | 136 | objects of| objects of| objects of| objects of| objects of| objects of| Maximum | 137 | 8 bytes | 16 bytes | 32 bytes | 64 bytes | 128 bytes | 512 bytes | Memory | 138 | | | | | | | Used | 139 | H L | H L | H L | H L | H L | H L | | 140 -----------------+-----------+-----------+-----------+-----------+-----------+-----------+-------------+ 141 std::sort | 8.25 8.26| 4.46 4.23| 2.67 2.33| 2.10 1.45| 1.72 1.11| 1.13 0.76| 786 MB | 142 pdqsort | 8.17 8.17| 4.42 4.11| 2.57 2.26| 1.78 1.37| 1.46 1.06| 0.97 0.70| 786 MB | 143 | | | | | | | | 144 std::stable_sort |10.28 10.25| 5.57 5.24| 3.68 3.26| 2.97 2.59| 2.60 2.46| 2.38 2.29| 1177 MB | 145 spinsort | 9.70 9.69| 5.25 4.89| 3.28 2.65| 2.41 1.92| 2.03 1.66| 1.66 1.52| 1176 MB | 146 flat_stable_sort |10.75 10.73| 6.44 5.99| 4.36 3.71| 3.59 2.86| 3.04 2.11| 1.64 1.45| 789 MB | 147 spreadsort | 5.10 5.10| 3.79 4.18| 2.22 1.88| 1.58 1.11| 1.51 0.99| 0.74 0.53| 786 MB | 148 | | | | | | | | 149 150 151`` 152] 153] 154[endsect] 155[endsect] 156