1 //constant definitions for the Boost Sort library 2 3 // Copyright Steven J. Ross 2001 - 2014 4 // Distributed under the Boost Software License, Version 1.0. 5 // (See accompanying file LICENSE_1_0.txt or copy at 6 // http://www.boost.org/LICENSE_1_0.txt) 7 8 // See http://www.boost.org/libs/sort for library home page. 9 #ifndef BOOST_SORT_SPREADSORT_DETAIL_CONSTANTS 10 #define BOOST_SORT_SPREADSORT_DETAIL_CONSTANTS 11 namespace boost { 12 namespace sort { 13 namespace spreadsort { 14 namespace detail { 15 //Tuning constants 16 //This should be tuned to your processor cache; 17 //if you go too large you get cache misses on bins 18 //The smaller this number, the less worst-case memory usage. 19 //If too small, too many recursions slow down spreadsort 20 enum { max_splits = 11, 21 //It's better to have a few cache misses and finish sorting 22 //than to run another iteration 23 max_finishing_splits = max_splits + 1, 24 //Sets the minimum number of items per bin. 25 int_log_mean_bin_size = 2, 26 //Used to force a comparison-based sorting for small bins, if it's faster. 27 //Minimum value 1 28 int_log_min_split_count = 9, 29 //This is the minimum split count to use spreadsort when it will finish in one 30 //iteration. Make this larger the faster boost::sort::pdqsort is relative to integer_sort. 31 int_log_finishing_count = 31, 32 //Sets the minimum number of items per bin for floating point. 33 float_log_mean_bin_size = 2, 34 //Used to force a comparison-based sorting for small bins, if it's faster. 35 //Minimum value 1 36 float_log_min_split_count = 8, 37 //This is the minimum split count to use spreadsort when it will finish in one 38 //iteration. Make this larger the faster boost::sort::pdqsort is relative to float_sort. 39 float_log_finishing_count = 4, 40 //There is a minimum size below which it is not worth using spreadsort 41 min_sort_size = 1000 }; 42 } 43 } 44 } 45 } 46 #endif 47