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

2.x: Flowable.reduce() to return Single, macro fusion #4484

Merged
merged 3 commits into from
Sep 6, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Sep 6, 2016

This PR adds the baseline for changing Flowable and Observable operators to return Single, Completable or Maybe but in case the user wants to go back to the original type via toFlowable or toObservable we switch to a natively Flowable/Observable operator (macro-fusion).

Benchmark comparison (i7 4790, Windows 7 x64, Java 8u102):

image

No changes were applied to Observable yet hence the roughly same result there. Flowable.reduce() has been updated plus there is a new FlowableReduce instead of scan().last().

@codecov-io
Copy link

codecov-io commented Sep 6, 2016

Current coverage is 78.12% (diff: 68.08%)

Merging #4484 into 2.x will decrease coverage by 0.06%

@@                2.x      #4484   diff @@
==========================================
  Files           494        496     +2   
  Lines         33661      33754    +93   
  Methods           0          0          
  Messages          0          0          
  Branches       5290       5303    +13   
==========================================
+ Hits          26319      26371    +52   
- Misses         5381       5415    +34   
- Partials       1961       1968     +7   

Powered by Codecov. Last update eddc153...b997011

@JakeWharton
Copy link
Contributor

👍

* </pre>
*
* The {@code Single.toObservable()} will check for this interface and call the {@link #fuseToObservable()}
* to return a Flowable which could be the Flowable-specific implementation of reduce(BiFunction).
* to return a Observable which could be the Observable-specific implementation of reduce(BiFunction).
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: an Observable

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixing it here and all the ~400 errors in Observable itself.

@akarnokd akarnokd merged commit 928e437 into ReactiveX:2.x Sep 6, 2016
@akarnokd akarnokd deleted the MacroFuseBack branch September 14, 2016 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants