Skip to content

2.x: reduce blockingX overhead, move internal observers to common pkg #4491

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

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Sep 6, 2016

This PR compacts the blockingX operators by extending CountDownLatch and implementing SingleObserver, CompletableObserver and MaybeObserver with the necessary blocking await mechanics.

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

image

In addition, the internal package subscribers.single and subscribers.completable has been removed and the classes moved into io.reactivex.internal.observers package. The old blocking enum helpers were removed as well.

The BlockingSingleSubscriber and BlockingSingleObserver abstract classes have been renamed to BlockingBaseX to avoid name confusion (they have nothing to do with the Single type).

@codecov-io
Copy link

Current coverage is 77.88% (diff: 58.49%)

Merging #4491 into 2.x will increase coverage by 0.03%

@@                2.x      #4491   diff @@
==========================================
  Files           500        498     -2   
  Lines         33905      33875    -30   
  Methods           0          0          
  Messages          0          0          
  Branches       5325       5326     +1   
==========================================
- Hits          26394      26382    -12   
+ Misses         5541       5519    -22   
- Partials       1970       1974     +4   

Powered by Codecov. Last update 10f727f...1129263

@JakeWharton
Copy link
Contributor

👍

@akarnokd akarnokd merged commit 1f0a116 into ReactiveX:2.x Sep 7, 2016
@akarnokd akarnokd deleted the BlockingXCompact906_1 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.

3 participants