Hi,

Please review this enhancement to improve the performance of BitSet traversal 
when using a stream.

  http://cr.openjdk.java.net/~psandoz/jdk/JDK-8170159-bitset-traverse/webrev/ 
<http://cr.openjdk.java.net/~psandoz/jdk/JDK-8170159-bitset-traverse/webrev/>

The associated issue started out life referring to the BitSet’s spliterator 
reporting SIZED, and to report that the cardinality has to be computed. This 
has some cost but performance analysis (see issue for attached benchmark) has 
shown that the cost is small compared to the cost of traversal. It is 
recognized that the cost is higher for smaller BitSets but not unduly so. Thus 
it was concluded that it was reasonable for the spliterator to report SIZED. 

The issue was adjusted to focus on improving the performance of the BitSet’s 
spliterator forEachRemaining method. For large randomized BitSets a 1.6x 
speedup can be observed, and for smaller sizes a more modest speed up. The 
prior conclusion about reporting SIZED still holds.

Thanks,
Paul.

Reply via email to