Description
Currently, we are using maxDoc >>> 7 as the default threshold before upgrading to BitSet. I am wondering if there is more optimal way of determining the right threshold.
The memory cost of FixedBitSet is always known, and we can get the selectivity from (# docs in buffer)/(maxDoc in buffer) so far. If the selectivity is high, consider upgrading to FixedBitSet earlier, else should delay the upgrade.