Arrays.parallel vs Arrays.asStream

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Sep 5 04:13:55 PDT 2012


it2-bootstrap is even more confusing now:

 Stream<T> Arrays.stream(T[] t)
 Stream<T> Arrays.asStream(T... t)
 Stream<T> Arrays.parallel(T[])

Is there any value in keeping asStream() around (besides being
questionable varargs bridge)? It has the performance drawbacks, as Brian
noted privately, would we better to dump it?

-Aleksey.

On 08/31/2012 08:14 PM, Aleksey Shipilev wrote:
> Hi,
> 
> I found the inconsistency in API for Arrays in it2 branch:
>   Arrays.asList(T... t)   // returns List<T>
>   Arrays.parallel(T[] t)  // returns Stream<T> (parallel)
>   Arrays.asStream(T... t) // returns Stream<T> (sequential?)
> 
> Two basic options:
>  - rename parallel() to asParallel() or asParallelStream().
>  - rename asStream() to sequential()
> 
> Also can be the mixture of both.
> 
> -Aleksey.
> 



More information about the lambda-dev mailing list