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: Improve the scalar source performance of Observable.(concat|switch)MapX #5918

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

akarnokd
Copy link
Member

This PR adds scalar source optimizations to Observable operators:

  • concatMapCompletable
  • concatMapSingle
  • concatMapMaybe
  • switchMapCompletable
  • switchMapSingle
  • switchMapMaybe

Benchmark

i7 4770K, Windows 7 x64, Java 8u162

The baseline is taken from #5914. The target is to be faster than using the plain concatMap or switchMap with a toObservable conversion. The apparent shortcomings of longer concatMapMaybe and concatMapSingle will be addressed in a subsequent PR.

image

@akarnokd akarnokd added this to the 2.2 milestone Mar 15, 2018
@codecov
Copy link

codecov bot commented Mar 15, 2018

Codecov Report

Merging #5918 into 2.x will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5918      +/-   ##
============================================
+ Coverage     98.19%   98.24%   +0.04%     
- Complexity     6002     6020      +18     
============================================
  Files           655      656       +1     
  Lines         43963    44004      +41     
  Branches       6090     6094       +4     
============================================
+ Hits          43169    43231      +62     
+ Misses          243      228      -15     
+ Partials        551      545       -6
Impacted Files Coverage Δ Complexity Δ
...rnal/operators/mixed/ObservableSwitchMapMaybe.java 100% <100%> (ø) 3 <2> (+1) ⬆️
...perators/mixed/ObservableConcatMapCompletable.java 99.24% <100%> (+0.59%) 3 <2> (-4) ⬇️
...ex/internal/operators/maybe/MaybeToObservable.java 100% <100%> (ø) 4 <2> (+1) ⬆️
...rnal/operators/mixed/ObservableConcatMapMaybe.java 100% <100%> (ø) 3 <2> (+1) ⬆️
.../internal/operators/single/SingleToObservable.java 100% <100%> (ø) 3 <2> (+1) ⬆️
...nal/operators/mixed/ObservableConcatMapSingle.java 100% <100%> (ø) 3 <2> (+1) ⬆️
...perators/mixed/ObservableSwitchMapCompletable.java 98.94% <100%> (+0.01%) 3 <2> (+1) ⬆️
...nal/operators/mixed/ObservableSwitchMapSingle.java 100% <100%> (ø) 3 <2> (+1) ⬆️
...ex/internal/operators/mixed/ScalarXMapZHelper.java 100% <100%> (ø) 13 <13> (?)
...rnal/operators/flowable/FlowableFlatMapSingle.java 92.93% <0%> (-2.72%) 2% <0%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5d99b7...84d3e00. Read the comment docs.

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.

2 participants