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.onErrorResumeNext improvements #6121

Merged

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Aug 1, 2018

This PR improves the structure of the onErrorResumeNext operator by inlining the subscription-arbiter and not updating the outstanding request amount one by one. The change reduces the per-item overhead, some indirection cost and the memory cost (+8 bytes for the field, -16/-28 bytes due to the inlined header+field)

In addition, the null-check has been inlined into the resume function call so that the crash will now include the original exception as well as the NPE in a CompositeException, just like almost all other cases throughout RxJava.

@codecov
Copy link

codecov bot commented Aug 1, 2018

Codecov Report

Merging #6121 into 2.x will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6121      +/-   ##
============================================
+ Coverage     98.25%   98.27%   +0.02%     
+ Complexity     6193     6192       -1     
============================================
  Files           667      667              
  Lines         44861    44858       -3     
  Branches       6213     6213              
============================================
+ Hits          44077    44085       +8     
+ Misses          243      234       -9     
+ Partials        541      539       -2
Impacted Files Coverage Δ Complexity Δ
...ternal/operators/flowable/FlowableOnErrorNext.java 100% <100%> (ø) 2 <0> (ø) ⬇️
.../operators/observable/ObservableFlatMapSingle.java 88.8% <0%> (-2.99%) 2% <0%> (ø)
.../io/reactivex/internal/schedulers/IoScheduler.java 89.24% <0%> (-2.16%) 9% <0%> (ø)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...rnal/operators/observable/ObservableSwitchMap.java 94.68% <0%> (-1.6%) 3% <0%> (ø)
...ternal/operators/completable/CompletableMerge.java 96.42% <0%> (-1.2%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableTimeoutTimed.java 98.37% <0%> (-0.82%) 3% <0%> (ø)
...ex/internal/operators/flowable/FlowableCreate.java 97.09% <0%> (-0.65%) 6% <0%> (ø)
...ain/java/io/reactivex/subjects/UnicastSubject.java 99.36% <0%> (-0.64%) 64% <0%> (-1%)
...al/operators/observable/ObservableWindowTimed.java 90.19% <0%> (-0.55%) 4% <0%> (ø)
... and 16 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 45cc53d...b195d48. Read the comment docs.

@akarnokd akarnokd added this to the 2.2 backlog milestone Aug 2, 2018
@akarnokd akarnokd merged commit 30afb3b into ReactiveX:2.x Aug 2, 2018
@akarnokd akarnokd deleted the OnErrorResumeNextRequestAccountingFix branch August 2, 2018 08:02
Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@davidmoten davidmoten left a comment

Choose a reason for hiding this comment

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

:+1

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.

3 participants