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

New implementation parallel joins #84

Merged
merged 2 commits into from
Nov 14, 2016
Merged

Conversation

peterneyens
Copy link
Contributor

@peterneyens peterneyens commented Nov 14, 2016

This changes the way fetches are inspected to parallelize independent fetches. It does this by adding a new Join construct to the Fetch structure. This Join is parallelized in a new intermediate interpreter which inspects the actual Free constructs and replaces cached fetches by Free.Pure.

It does play a bit fast and loose with the laws with this fiddling with Free under the hood, but it now executes code in a fetch.map(...) or a fetch.flatMap(...) only once.

(The other PR updating cats and adding Scala 2.12 support should be merged first).

@codecov-io
Copy link

codecov-io commented Nov 14, 2016

Current coverage is 76.03% (diff: 87.71%)

Merging #84 into master will increase coverage by 0.36%

@@             master        #84   diff @@
==========================================
  Files             9         10     +1   
  Lines           226        242    +16   
  Methods         224        240    +16   
  Messages          0          0          
  Branches          2          2          
==========================================
+ Hits            171        184    +13   
- Misses           55         58     +3   
  Partials          0          0          

Powered by Codecov. Last update 56eb7f7...53b443a

@peterneyens
Copy link
Contributor Author

I'll rebase this on the current master.

This adds the `Join` construct to the underlying Fetch structure.
The `Join`s are paralellized in a new interpreter `parallelJoinPhase`.
The new parallel optimization fiddles with the `Free` structure to look
for independent queries and to simplify queries if the results are
cached. Everything in a `fetch.map(...)` or `fetch.flatMap(...)` should
be only executed once (currently this isn't yet the case for pure
fetches created with `Fetch.pure`).
Copy link
Contributor

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

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

LGTM!

@juanpedromoreno juanpedromoreno mentioned this pull request Nov 14, 2016
@ghost
Copy link

ghost commented Nov 14, 2016

LGTM :shipit:

@juanpedromoreno juanpedromoreno merged commit 8927046 into master Nov 14, 2016
@juanpedromoreno juanpedromoreno deleted the peter-refactor-join-2 branch November 14, 2016 11:54
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.

None yet

3 participants