Netflix/RxJava — pull request #875 by akarnokd (2014-02-14 18:50:31+00:00)
Title: Bounded replay subject proposal

Proposal for #865. Not aimed at for merging.

Subscription and unsubscription is serialized with the regular events so this implementation should solve #658 as well. A property of this implementation due to queue/drain approach is that a new subscriber's thread might steal the processing loop. To mitigate this, scheduler overloads are provided to capture the processing loop.

Unfortunately, the performance is 2-3 times worse in unbounded mode compared against current ReplaySubject implementation when run with a simple 1M onNext calls. The replay after completion is about 10% slower.

I would guess the enqueue/dequeue operation adds quite a substantial overhead.