Netflix/RxJava — pull request #1181 by akarnokd (2014-05-09 15:51:40+00:00)
Title: Behavior subject time gap fix

This fix should make sure subscribing between two event emissions won't create a gap in the received events. I had to implement my own subscription management to ensure the required coordination behavior.

Performance comparison for simple pass-through behavior:
PublishSubject (master) ~86 MOps/s
BehaviorSubject (master) ~47 MOps/s
BehaviorSubject (this) ~46 MOps/s

The relative slowness compared to PS is due the volatile write on each element and the additional ~1MOps/s is due to the subscription coordination.