Extending Collector to handle a post-transform
Tim Peierls
tim at peierls.net
Tue Jun 11 10:22:06 PDT 2013
On Tue, Jun 11, 2013 at 1:04 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> 1. Reducing boxing during reducing. Currently, the reducing collectors
> will unbox, compute a new result, and rebox, on every element. That ugly
> and slow. With a post-transform, we can use a hidden mutable holder as our
> internal representation, and still only expose "Collector from T to Long".
>
Nice, indeed, but won't the internal type still appear as a type parameter
of Collector?
2. By dialing back on the accumulator function's choice of operating
> functionally or ability to produce a new value (which was really only
> required by reduce), we can get rid of the characteristic STRICTLY_MUTATIVE
> which introduces complexity into the API and implementation.
>
Also nice.
--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130611/94cd4a36/attachment.html
More information about the lambda-libs-spec-experts
mailing list