linux_single.qbk 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. [/===========================================================================
  2. Copyright (c) 2017 Steven Ross, Francisco Tapia, Orson Peters
  3. Distributed under the Boost Software License, Version 1.0
  4. See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt
  6. =============================================================================/]
  7. [section:linux_single 2.5.- Linux Benchmarks]
  8. This library contains a benchmark folder with programs to measure the speed of the algorithms on your machine and operating system.
  9. These are short benchmarks to test speed with different kinds of data ( random, sorted, sorted plus unsorted append at end ...)
  10. This 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
  11. The results obtained with GCC 6.3 on Linux, in the benchmark_numbers with integers are:
  12. [section:near_sorted Near Sorted Data]
  13. [:
  14. [h4[_Near Sorted Data With 100 000 000 64 bits Integers]]
  15. benchmark/single/benchmark_numbers.cpp : This benchmark shows the results obtained with several kind of integers numbers (random, and near
  16. sorted).
  17. The 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.
  18. [*[teletype]
  19. ``
  20. | | | | | | |
  21. | | |std:: | |flat_ | |
  22. | std::sort | pdqsort |stable_sort| spinsort |stable_sort|spreadsort |
  23. ----------------------------+-----------+-----------+-----------+-----------+-----------+-----------+
  24. random | 8.21 | 3.99 | 8.62 | 9.73 | 10.80 | 4.26 |
  25. | | | | | | |
  26. sorted | 1.84 | 0.13 | 4.88 | 0.06 | 0.07 | 0.06 |
  27. sorted + 0.1% end | 6.41 | 2.91 | 4.92 | 0.41 | 0.36 | 3.16 |
  28. sorted + 1% end | 14.15 | 3.39 | 4.97 | 0.55 | 0.49 | 3.65 |
  29. sorted + 10% end | 6.72 | 4.15 | 5.73 | 1.32 | 1.40 | 4.39 |
  30. | | | | | | |
  31. sorted + 0.1% middle | 4.41 | 3.31 | 6.58 | 1.89 | 2.61 | 3.29 |
  32. sorted + 1% middle | 4.39 | 3.62 | 7.06 | 2.12 | 3.07 | 3.80 |
  33. sorted + 10% middle | 6.35 | 4.71 | 9.56 | 4.02 | 5.49 | 4.99 |
  34. | | | | | | |
  35. reverse sorted | 1.36 | 0.26 | 5.12 | 0.13 | 0.14 | 1.87 |
  36. reverse sorted + 0.1% end | 7.57 | 2.92 | 5.22 | 0.52 | 0.42 | 2.83 |
  37. reverse sorted + 1% end | 4.99 | 3.33 | 5.29 | 0.66 | 0.55 | 3.45 |
  38. reverse sorted + 10% end | 4.62 | 4.16 | 6.03 | 1.45 | 1.44 | 4.35 |
  39. | | | | | | |
  40. reverse sorted + 0.1% middle| 4.38 | 3.29 | 6.52 | 1.89 | 2.54 | 3.28 |
  41. reverse sorted + 1% middle| 4.43 | 3.65 | 7.09 | 2.12 | 3.09 | 3.81 |
  42. reverse sorted + 10% middle| 6.42 | 4.70 | 9.46 | 4.02 | 5.53 | 5.00 |
  43. | | | | | | |
  44. ``
  45. ]
  46. ]
  47. [endsect]
  48. [section:complex_benchmarks Complex (Several Types)]
  49. [:
  50. The next results are obtained from more complex benchmarks, not include in the library because they use non free software
  51. (If you are interested in their code, contact fjtapia@gmail.com)
  52. There are 3 types of benchmarks,
  53. [:
  54. *64 bits integers
  55. *strings
  56. *objects of several sizes.
  57. The 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.
  58. ]
  59. [h4[_100 000 000 Numbers of 64 bits Randomly Filled]]
  60. [*[teletype]
  61. ``
  62. | | |
  63. | Time | Maximum |
  64. | secs | Memory Used |
  65. --------------------+---------+-------------+
  66. std::sort | 8.2154 | 784 MB |
  67. pdqsort | 3.9356 | 784 MB |
  68. | | |
  69. std::stable_sort | 8.5016 | 1176 MB |
  70. spinsort | 9.4262 | 1175 MB |
  71. flat_stable_sort | 10.6790 | 788 MB |
  72. spreadsort | 4.2248 | 785 MB |
  73. | | |
  74. ``
  75. ]
  76. [h4[_10 000 000 Strings Randomly Filled]]
  77. [*[teletype]
  78. ``
  79. | | |
  80. | Time | Maximum |
  81. | secs | Memory Used |
  82. --------------------+---------+-------------+
  83. std::sort | 6.2442 | 822 MB |
  84. pdqsort | 6.6661 | 821 MB |
  85. | | |
  86. std::stable_sort | 12.2620 | 1134 MB |
  87. spinsort | 8.5996 | 978 MB |
  88. flat_stable_sort | 9.2559 | 978 MB |
  89. spreadsort | 2.4323 | 822 MB |
  90. | | |
  91. ``
  92. ]
  93. [h4[_Objects Randomly Filled]]
  94. [:
  95. The objects are arrays of 64 bits numbers
  96. They are compared in two ways :
  97. [:
  98. (H) Heavy : The comparison is the sum of all the numbers of the array.
  99. (L) Light : The comparison is using only the first element of the array,
  100. as a key
  101. ]
  102. ]
  103. [*[teletype]
  104. ``
  105. | | | | | | | |
  106. | 100000000 | 50000000 | 25000000 | 12500000 | 6250000 | 1562500 | |
  107. | objects of| objects of| objects of| objects of| objects of| objects of| Maximum |
  108. | 8 bytes | 16 bytes | 32 bytes | 64 bytes | 128 bytes | 512 bytes | Memory |
  109. | | | | | | | Used |
  110. | H L | H L | H L | H L | H L | H L | |
  111. -----------------+-----------+-----------+-----------+-----------+-----------+-----------+-------------+
  112. 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 |
  113. 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 |
  114. | | | | | | | |
  115. 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 |
  116. 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 |
  117. 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 |
  118. 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 |
  119. | | | | | | | |
  120. ``
  121. ]
  122. ]
  123. [endsect]
  124. [endsect]