I'd like to do some benchmarking to ground the decision on what should be the default. But benchmarking Binary search is not always straightforward. I.E. I am jumping in somewhat over my head.
I believe this was fairly heavily benchmarked when configurability of the B value was removed before 1.0 and it turned out to not really matter much if at all. I can’t find that PR right now but it would be worth tracking down for background.
There is an interesting variation of binary search, where you lay out elements of the array in a cache friendly manner. That is, if text book binary search will look at the middle element first, and than at .25 and .75 quantiles (which may be far away cache wise), this variation will look on the first and second or third element: http://bannalia.blogspot.ru/2015/06/cache-friendly-binary-search.html
The old with_b constructor used a runtime-level B, there was some doubt whether it would be compatible with future extensions of BTreeMap (generic parameter-selected B?).
Yes, The move from a runtime-level B to a constant was important for many performance improvements. Definitely a win! I hope we can get with_b back when we get type level numbers, but we can have that conversation when they arrive. In the meantime I just wonder if 6 is the best choice, and on what evidence we can decide.
I love how open rust is to enthusiastic respectful new contributors. I’d love to help do the benchmarking to decide these things. I just want to make sure that I am being respectful of the team’s time, by bringing up evidence that they will find useful.