-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fork devgrok's changes #1
base: master
Are you sure you want to change the base?
Conversation
|
||
return $ do | ||
left1 <- left0 | ||
right1 <- right0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two are just monadic actions on m
, which in our case, is IO
. So this could be done with Async.
@devgrok It would be great if you could benchmark this one too. |
I've added concurrency in the tree merge. |
concurrently | ||
(runEitherT $ Stream.next leftStream) | ||
(runEitherT $ Stream.next rightStream) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a little refactor this does indeed work. Haven't bench marked it though.
The Stream.next will do the merge from further in the tree. I think it should offer pretty good parallelism.
Benchmarks here on simulated data reduce memory consumption by 10% and is about 30% faster on my machine. Distributions of keys obviously matters, but it's a very good sign. |
@jacobstanley you might find this one interesting. |
600cb1d
to
049a27d
Compare
@devgrok This is what I was thinking when I saw your changes.
By pushing the merge earlier, it should become a lot easier to add concurrency.