Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-22 Thread Paul Sandoz
> On 21 Nov 2016, at 20:00, Tagir Valeev wrote: > > Hello! > >> Hi Tagir, >> >> In the original issue i was pondering using SIZED for smaller bit sets and >> non-SIZED for larger bit sets, since we stride over the longs themselves >> when calculating the size (should be intrinsic to count th

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-21 Thread Tagir Valeev
Hello! > Hi Tagir, > > In the original issue i was pondering using SIZED for smaller bit sets and > non-SIZED for larger bit sets, since we stride over the longs themselves when > calculating the size (should be intrinsic to count the set bits, at least on > x86). Supporting both is fairly simp

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-21 Thread Paul Sandoz
Hi Tagir, In the original issue i was pondering using SIZED for smaller bit sets and non-SIZED for larger bit sets, since we stride over the longs themselves when calculating the size (should be intrinsic to count the set bits, at least on x86). Supporting both is fairly simple, but you are cor

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-21 Thread Tagir F. Valeev
Hello! Is it necessary to report SIZED characteristic and calculate the cardinality in advance making two-pass traversal? This improves bitSet.stream().toArray() performance (also bitSet.stream().count(), but it's rare case in practice). However this is just waste of time for any other stream oper

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-16 Thread Paul Sandoz
> On 16 Nov 2016, at 07:21, Martin Buchholz wrote: > > should the spec say that the spliterator is late binding? > I logged this issue: https://bugs.openjdk.java.net/browse/JDK-8169808 We sold also consider CharSequence as well (and there

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-16 Thread Martin Buchholz
should the spec say that the spliterator is late binding? On Wed, Nov 16, 2016 at 7:13 AM, Martin Buchholz wrote: > I've been looking, but all I got is: > s/passed/past/ >

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-16 Thread Martin Buchholz
I've been looking, but all I got is: s/passed/past/

Re: 8072784: Better spliterator implementation for BitSet.stream()

2016-11-15 Thread Paul Sandoz
> On 14 Nov 2016, at 17:56, Paul Sandoz wrote: > > Hi, > > Please review this patch implementing a spliterator for BitSet: > > > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8072784-bitset-stream-spliterator/webrev/ > > The spliterator is SIZED but not SUBSIZED, the bit set’s cardinality is