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

perfect waker for array::Merge #75

Merged
merged 1 commit into from
Nov 16, 2022
Merged

perfect waker for array::Merge #75

merged 1 commit into from
Nov 16, 2022

Conversation

yoshuawuyts
Copy link
Owner

@yoshuawuyts yoshuawuyts commented Nov 14, 2022

Ref #21.

Speeds up array::merge by copying over the implementation from vec::merge. We can probably speed this up even further by creating a non-allocating variant of WakerList - we may need to for #68 anyway. But for now a 2-20x speedup seems like plenty, and we can switch out the impl later without any issue anyway.

❯ critcmp main patch  -f array::merge
group                main                                   patch
-----                ----                                   -----
array::merge 10      1.64      4.2±0.26µs        ? ?/sec    1.00      2.6±0.09µs        ? ?/sec
array::merge 100     9.35   376.3±25.42µs        ? ?/sec    1.00     40.3±1.95µs        ? ?/sec
array::merge 1000    21.88    40.0±1.72ms        ? ?/sec    1.00  1827.5±46.92µs        ? ?/sec

Copy link
Collaborator

@eholk eholk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

It'd be nice if we could factor out this code and the vec code and make it independent of the underlying container, but I think that's a problem for later.

src/stream/merge/array.rs Outdated Show resolved Hide resolved
src/stream/merge/array.rs Show resolved Hide resolved
@yoshuawuyts yoshuawuyts merged commit eb31f45 into main Nov 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the fast-merge-array branch November 16, 2022 15:53
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.

2 participants