Skip to content

Commit 1785f6e

Browse files
committed
add subscribeOn(computation()) to the ObserveOn perf methods
1 parent 54b5c9d commit 1785f6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/perf/java/rx/operators/OperatorObserveOnPerf.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ public int getSize() {
4949
@Benchmark
5050
public void observeOnComputation(Input input) throws InterruptedException {
5151
LatchedObserver<Integer> o = input.newLatchedObserver();
52-
input.observable.observeOn(Schedulers.computation()).subscribe(o);
52+
input.observable.subscribeOn(Schedulers.computation()).observeOn(Schedulers.computation()).subscribe(o);
5353
o.latch.await();
5454
}
5555

5656
@Benchmark
5757
public void observeOnNewThread(Input input) throws InterruptedException {
5858
LatchedObserver<Integer> o = input.newLatchedObserver();
59-
input.observable.observeOn(Schedulers.newThread()).subscribe(o);
59+
input.observable.subscribeOn(Schedulers.computation()).observeOn(Schedulers.newThread()).subscribe(o);
6060
o.latch.await();
6161
}
6262

6363
@Benchmark
6464
public void observeOnImmediate(Input input) throws InterruptedException {
6565
LatchedObserver<Integer> o = input.newLatchedObserver();
66-
input.observable.observeOn(Schedulers.immediate()).subscribe(o);
66+
input.observable.subscribeOn(Schedulers.computation()).observeOn(Schedulers.immediate()).subscribe(o);
6767
o.latch.await();
6868
}
6969

0 commit comments

Comments
 (0)