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

Fork devgrok's changes #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fork devgrok's changes #1

wants to merge 4 commits into from

Conversation

HuwCampbell
Copy link
Contributor

@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.


return $ do
left1 <- left0
right1 <- right0
Copy link
Contributor Author

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.

@HuwCampbell
Copy link
Contributor Author

@devgrok It would be great if you could benchmark this one too.

@HuwCampbell
Copy link
Contributor Author

I've added concurrency in the tree merge.

Comment on lines +121 to +123
concurrently
(runEitherT $ Stream.next leftStream)
(runEitherT $ Stream.next rightStream)
Copy link
Contributor Author

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.

@HuwCampbell
Copy link
Contributor Author

HuwCampbell commented Apr 27, 2020

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.

@HuwCampbell
Copy link
Contributor Author

@jacobstanley you might find this one interesting.

@HuwCampbell HuwCampbell force-pushed the master branch 3 times, most recently from 600cb1d to 049a27d Compare April 4, 2023 07:22
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.

1 participant