Extending Collector to handle a post-transform
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
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.
More information about the lambda-libs-spec-observers