This Week in Lambda Libs

Brian Goetz brian.goetz at oracle.com
Fri Oct 26 10:32:38 PDT 2012


I had promised to do a weekly update of what was happening in the repo, 
but fell down on that due to travel.  Here's an accumulated update to 
date.  (More info in the hg logs.)

*Sept 25, 2012 - Oct 24, 2012
*

*Added Stream.concat (Paul). *Added Stream.concat(Stream<T> 
otherStream). Not clear whether this should be an instance method on 
Stream, or a static method; also not clear whether it should take Stream 
or Streamable (the latter works better if we want to go to detached 
pipelines.)

*Refactor of Stream Op base types (Brian and Paul). *Numerous refactors 
in the hierarchy for operations; current hierarchy is a single base type 
StreamOp, with subtypes for IntermediateOp, StatefulOp, and TerminalOp.

*Stream flags improvements (Paul). *Added an "encounter order" flag. 
Define flags with an enum. Make flags into declarative properties of 
Ops, where an op can declare that they preserve, inject, or clear a 
given flag, and move responsibility for flag computation into 
AbstractPipeline. Pass flags to wrap{Sink,Iterator} so they can act on 
the current set of flags.

*Introduction of PipelineHelper (Brian and Paul). *All computations 
about the current state of the pipeline are no centralized in 
PipelineHelper (serial and parallel versions), which is passed to 
StreamOp.evaluate{Serial,Parallel}.

*New parallel implementations (Brian and Paul). *Parallel implementation 
of groupBy, removeDuplicates, toArray.

*Improvements in Node and NodeBuilder (Paul). *Node is a simple 
conc-tree representation, which can both be the output or source of a 
stream. Parallel operations that can produce flat arrays are encouraged 
to do so; tree shape is known to Node so operations like toArray can 
become no-ops if upstream ops have already produced a flattened array. 
More optimizations to effectively use known source/split size to avoid 
copying.

*Removal of MapStream (Brian). *While at first having map-shaped streams 
was an "obvious" requirement, it turns out that they failed a 
cost-benefit analysis. They introduced a lot of complexity into the 
implementation, and in our explorations for use cases, we found that 
most were well-enough handled by map.{keys,values,entrySet}().stream(), 
or by stream.reduceBy (the fused group+reduce operation).

*Common implementations of forEach/reduce (Brian). *Factored out common 
mutable-reduce logic into OpUtils; elemented separate decomposition 
implementation in ForEachOp, GroupByOp, UniqOp, FoldUp, SeedlessFoldUp. 
Reduced boxing overhead in folding when intermediate representation 
(e.g., T) was different from final representation (e.g., Optional<T>).

*Optimizations in StreamBuilder (Mike). *Implement a no-copy List 
optimized for append*-iterate*.

*Spliterator implementation improvements (Mike). *Broader/better 
implementation of Spliterator throughout Collections.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20121026/5689a3a9/attachment.html 


More information about the lambda-libs-spec-experts mailing list