Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore PrependSpliterator #59

Closed
5 tasks done
amaembo opened this issue Jan 26, 2016 · 0 comments
Closed
5 tasks done

Restore PrependSpliterator #59

amaembo opened this issue Jan 26, 2016 · 0 comments
Milestone

Comments

@amaembo
Copy link
Owner

amaembo commented Jan 26, 2016

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
amaembo added a commit that referenced this issue Jan 27, 2016
JavaDoc for new append/prepend methods; changes
@amaembo amaembo added this to the 0.5.4 milestone Jan 27, 2016
@amaembo amaembo closed this as completed Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant