hg: lambda/lambda/jdk: Replacement for VariableStreamBuilder that doesn't do re-allocs. Better chunk sizing will come in future updates.
brian.goetz at oracle.com
Thu Oct 4 19:33:02 PDT 2012
Glad to see SB getting cleaned up.
Code review comments:
- The warning in begin() should probably be an ISE, since the
semantics of begin(n) are that you are committing to provide n elements.
Similar for toArray -- I think you should throw ISE if the size is
- Initial sizes in spined SB seem large.
- In SpinedSB, probably not worth keeping global size/capacity up to
date; instead, just the current index into chunks and the current index
into the current chunk are enough to keep track of (a) where to write to
next, (b) when to switch chunks, and (c) when to reallocate the chunks
- Do we still need the junky old VariableStreamBuilder?
- Need SBs for each stream shape. Should put factories on the Shape
(shape.makeFixedStreamBuilder(n), shape.makeStreamBuilder(), etc.) For
KV streams, probably best to allocate a pair of arrays, one for keys,
one for values.
On 10/4/2012 9:26 PM, mike.duigou at oracle.com wrote:
> Changeset: f673f3d4682f
> Author: mduigou
> Date: 2012-10-04 18:26 -0700
> URL: http://hg.openjdk.java.net/lambda/lambda/jdk/rev/f673f3d4682f
> Replacement for VariableStreamBuilder that doesn't do re-allocs. Better chunk sizing will come in future updates.
> ! src/share/classes/java/util/streams/StreamBuilders.java
> ! test-ng/tests/org/openjdk/tests/java/util/streams/ops/StreamOpTestCase.java
More information about the lambda-dev