introduction.qbk 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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:introduction 1.- Introduction]
  8. [:
  9. The goal of the Boost Sort Library is provide to the users, the most modern, fast, and memory-efficient sorting algorithms.
  10. This library provides stable and unstable sorting algorithms, in single threaded and parallel versions.
  11. These algorithms do not use any other library or utility. The parallel algorithms need a C++11 compliant compiler.
  12. [h4[_Single Thread Algorithms]]
  13. [*[teletype]
  14. ``
  15. | | | | Comparison |
  16. Algorithm |Stable | Additional memory |Best, average, and worst case | method |
  17. ------------------+-------+----------------------------+--------------------------------------------+---------------------+
  18. spreadsort | no | key_length | N, N sqrt(LogN), min(N logN, N key_length) | Hybrid radix sort |
  19. pdqsort | no | Log N | N, N LogN, N LogN | Comparison operator |
  20. spinsort | yes | N / 2 | N, N LogN, N LogN | Comparison operator |
  21. flat_stable_sort | yes |size of the data / 256 + 8K | N, N LogN, N LogN | Comparison operator |
  22. | | | | |
  23. ``
  24. ]
  25. * *spreadsort* is an extremely fast hybrid radix sort algorithm, designed and developed by Steven Ross.
  26. * *pdqsort* is a improvement of the quick sort algorithm, designed and developed by Orson Peters.
  27. * *spinsort* is a stable sort that is fast with random or nearly sorted data, designed and developed by Francisco Tapia.
  28. * *flat_stable_sort* is a stable sort that uses very little additional memory (around 1% of the size of the data), providing 80% - 90% of the speed of
  29. spinsort, designed and developed by Francisco Tapia.
  30. [h4[_Parallel Algorithms]]
  31. [*[teletype]
  32. ``
  33. | | | |
  34. Algorithm |Stable | Additional memory |Best, average, and worst case |
  35. ----------------------+-------+------------------------+------------------------------+
  36. block_indirect_sort | no |block_size * num_threads| N, N LogN , N LogN |
  37. sample_sort | yes | N | N, N LogN , N LogN |
  38. parallel_stable_sort | yes | N / 2 | N, N LogN , N LogN |
  39. | | | |
  40. ``
  41. ]
  42. * *Sample_sort* is a implementation of the [*[@ https://en.wikipedia.org/wiki/Samplesort Samplesort algorithm]] done by Francisco Tapia.
  43. * *Parallel_stable_sort* is based on the samplesort algorithm, but using a half of the memory used by sample_sort, conceived and implemented by Francisco Tapia.
  44. * *Block_indirect_sort* is a novel high-speed parallel sort algorithm with low additional memory consumption, conceived and implemented by Francisco Tapia.
  45. The *block_size* is an internal parameter of the algorithm, which in order to achieve the
  46. highest speed, changes according to the size of the objects to sort according to the next table. The strings use a block_size of 128.
  47. [*[teletype]
  48. ``
  49. | | | | | | | |
  50. object size (bytes) | 1 - 15 | 16 - 31 | 32 - 63 | 64 - 127|128 - 255|256 - 511| 512 - |
  51. --------------------------------+--------+---------+---------+---------+---------+---------+----------+
  52. block_size (number of elements) | 4096 | 2048 | 1024 | 768 | 512 | 256 | 128 |
  53. | | | | | | | |
  54. ``
  55. ]
  56. ]
  57. [endsect]