You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While TailConcatSpliterator is implemented (see #55) and useful, the PrependSpliterator which allows adding exactly one element at the beginning of the stream is very important use case for headTail scenarios (see #54). As recursively defined operations may use prepend for every single element, it's significant allocation pressure to create TailConcatSpliterator and ArraySpliterator every time. Replacing them both with simple PrependSpliterator reduces allocation and improves overall performance of recursive headTail operations.
Implement StreamEx.prepend(T) and StreamEx.append(T) (for symmetry)
Implement PrependSpliterator
JavaDoc for new methods
Tests
Changes
The text was updated successfully, but these errors were encountered:
While
TailConcatSpliterator
is implemented (see #55) and useful, thePrependSpliterator
which allows adding exactly one element at the beginning of the stream is very important use case forheadTail
scenarios (see #54). As recursively defined operations may useprepend
for every single element, it's significant allocation pressure to createTailConcatSpliterator
andArraySpliterator
every time. Replacing them both with simplePrependSpliterator
reduces allocation and improves overall performance of recursiveheadTail
operations.StreamEx.prepend(T)
andStreamEx.append(T)
(for symmetry)PrependSpliterator
The text was updated successfully, but these errors were encountered: