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

Adds sort stream transformation incl. tests #245

Merged
merged 1 commit into from
Mar 18, 2015

Conversation

svozza
Copy link
Collaborator

@svozza svozza commented Mar 9, 2015

As mentioned in #169

adds noValueErrorTest for sort

split sort into sort and sortBy

adds noValueErrorTest for sort

split sort into sort and sortBy
@svozza
Copy link
Collaborator Author

svozza commented Mar 18, 2015

Does anyone have time to take a look at this? Would be good to get rid of one of the last 6+ month old PRs.

@apaleslimghost
Copy link
Collaborator

This looks good. Something to think about is that this buffers the entire stream before sorting. We could do an online insertion sort, but it's a speed/memory tradeoff: insertion sort would use O(n²) memory but do the sort while streaming which is probably more efficient.

I think we should go ahead with this pull request and maybe revisit this in the future with benchmarks.

@svozza
Copy link
Collaborator Author

svozza commented Mar 18, 2015

Yeah, we could build up the sorted array with a binary insert or something. Could definitely be a nice way of doing it if the benchmarks warrant it.

@apaleslimghost
Copy link
Collaborator

On the other hand, I trust the build-in sort much better than anything I could write.

I'll go ahead and merge this.

apaleslimghost added a commit that referenced this pull request Mar 18, 2015
Adds sort stream transformation incl. tests
@apaleslimghost apaleslimghost merged commit 3704174 into caolan:master Mar 18, 2015
@svozza svozza mentioned this pull request Apr 9, 2015
@vqvu vqvu added this to the v2.5.0 milestone Apr 17, 2015
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

Successfully merging this pull request may close these issues.

3 participants