Skip to content

Commit 4571e92

Browse files
Updates while validating no major performance and memory regressions
1 parent 8b97295 commit 4571e92

7 files changed

+53
-34
lines changed

rxjava-core/src/perf/java/rx/ObservableCreatePerformance.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public void call() {
4949
*
5050
* --- always with CompositeSubscription():
5151
*
52-
* Run: 10 - 13,716,405 ops/sec
53-
* Run: 11 - 13,920,015 ops/sec
54-
* Run: 12 - 14,122,977 ops/sec
55-
* Run: 13 - 14,048,534 ops/sec
56-
* Run: 14 - 13,824,451 ops/sec
52+
* Run: 10 - 15,846,002 ops/sec
53+
* Run: 11 - 15,671,181 ops/sec
54+
* Run: 12 - 15,401,580 ops/sec
55+
* Run: 13 - 15,841,283 ops/sec
56+
* Run: 14 - 15,317,970 ops/sec
5757
*/
5858
public long timeCreateAndSubscribe() {
5959

rxjava-core/src/perf/java/rx/operators/OperatorFromIterablePerformance.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public static void main(String args[]) {
1919

2020
@Override
2121
public void call() {
22-
spt.timeRepetitionsEmission();
23-
// spt.timeTenLongs();
24-
// spt.time1000Longs();
22+
// spt.timeRepetitionsEmission();
23+
spt.timeTenLongs();
24+
// spt.time1000Longs();
2525
}
2626
});
2727
} catch (Exception e) {
@@ -114,11 +114,11 @@ public void remove() {
114114
*
115115
* --- New synchronous implementation with OperatorSubscription and unsubscribe support
116116
*
117-
* Run: 10 - 7,957,006 ops/sec
118-
* Run: 11 - 8,017,973 ops/sec
119-
* Run: 12 - 8,020,519 ops/sec
120-
* Run: 13 - 8,220,250 ops/sec
121-
* Run: 14 - 7,770,853 ops/sec
117+
* Run: 10 - 8,096,667 ops/sec
118+
* Run: 11 - 8,382,131 ops/sec
119+
* Run: 12 - 8,256,288 ops/sec
120+
* Run: 13 - 8,139,703 ops/sec
121+
* Run: 14 - 8,011,023 ops/sec
122122
*/
123123
public long timeTenLongs() {
124124

rxjava-core/src/perf/java/rx/operators/OperatorMapPerformance.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public void call() {
2828
/**
2929
* Observable.from(1L).map((l) -> { l+1})
3030
*
31-
* Run: 10 - 10,699,215 ops/sec
32-
* Run: 11 - 10,554,267 ops/sec
33-
* Run: 12 - 10,663,481 ops/sec
34-
* Run: 13 - 10,500,032 ops/sec
35-
* Run: 14 - 10,556,629 ops/sec
31+
* Run: 10 - 11,375,632 ops/sec
32+
* Run: 11 - 11,390,325 ops/sec
33+
* Run: 12 - 11,655,527 ops/sec
34+
* Run: 13 - 11,528,440 ops/sec
35+
* Run: 14 - 11,321,181 ops/sec
3636
*/
3737
public long timeMapPlusOne() {
3838

rxjava-core/src/perf/java/rx/operators/OperatorMergePerformance.java

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import rx.perf.AbstractPerformanceTester;
55
import rx.perf.IntegerSumObserver;
66
import rx.perf.LongSumObserver;
7+
import rx.schedulers.Schedulers;
78
import rx.util.functions.Action0;
89

910
public class OperatorMergePerformance extends AbstractPerformanceTester {
@@ -16,7 +17,7 @@ public static void main(String args[]) {
1617

1718
@Override
1819
public void call() {
19-
spt.timeRepetitionsEmission();
20+
spt.timeRepetitionsEmissionSynchronous();
2021
// spt.timeMergeAandBwithSingleItems();
2122
// spt.timeMergeAandBwith100Items();
2223
}
@@ -28,13 +29,13 @@ public void call() {
2829
}
2930

3031
/**
31-
* Run: 10 - 44,561,691 ops/sec
32-
* Run: 11 - 44,038,119 ops/sec
33-
* Run: 12 - 44,032,689 ops/sec
34-
* Run: 13 - 43,390,724 ops/sec
35-
* Run: 14 - 44,088,600 ops/sec
32+
* Run: 10 - 32,609,617 ops/sec
33+
* Run: 11 - 33,511,839 ops/sec
34+
* Run: 12 - 34,768,096 ops/sec
35+
* Run: 13 - 32,376,499 ops/sec
36+
* Run: 14 - 33,166,835 ops/sec
3637
*/
37-
public long timeRepetitionsEmission() {
38+
public long timeRepetitionsEmissionSynchronous() {
3839

3940
Observable<Long> sA = Observable.from(ITERABLE_OF_REPETITIONS);
4041
Observable<Long> sB = Observable.from(ITERABLE_OF_REPETITIONS);
@@ -45,6 +46,24 @@ public long timeRepetitionsEmission() {
4546
return o.sum;
4647
}
4748

49+
/**
50+
* Run: 10 - 7,911,392,405 ops/sec
51+
* Run: 11 - 8,620,689,655 ops/sec
52+
* Run: 12 - 8,333,333,333 ops/sec
53+
* Run: 13 - 6,775,067,750 ops/sec
54+
* Run: 14 - 9,074,410,163 ops/sec
55+
*/
56+
public long timeRepetitionsEmissionConcurrent() {
57+
58+
Observable<Long> sA = Observable.from(ITERABLE_OF_REPETITIONS).subscribeOn(Schedulers.newThread());
59+
Observable<Long> sB = Observable.from(ITERABLE_OF_REPETITIONS).subscribeOn(Schedulers.newThread());
60+
Observable<Long> s = Observable.merge(sA, sB);
61+
62+
LongSumObserver o = new LongSumObserver();
63+
s.subscribe(o);
64+
return o.sum;
65+
}
66+
4867
/**
4968
* Observable.merge(from(1), from(1))
5069
*

rxjava-core/src/perf/java/rx/operators/OperatorTakePerformance.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public void call() {
2727
/**
2828
* Observable.range(0, 10).take(5);
2929
*
30-
* Run: 10 - 8,780,556 ops/sec
31-
* Run: 11 - 8,822,590 ops/sec
32-
* Run: 12 - 8,842,733 ops/sec
33-
* Run: 13 - 8,825,486 ops/sec
34-
* Run: 14 - 8,771,545 ops/sec
30+
* Run: 10 - 7,936,306 ops/sec
31+
* Run: 11 - 8,220,209 ops/sec
32+
* Run: 12 - 7,783,276 ops/sec
33+
* Run: 13 - 8,435,373 ops/sec
34+
* Run: 14 - 7,894,454 ops/sec
3535
*/
3636
public long timeTake5() {
3737

rxjava-core/src/perf/java/rx/operators/OperatorZipPerformance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public static void main(String args[]) {
1616

1717
@Override
1818
public void call() {
19-
// spt.timeZipAandBwithSingleItems();
20-
spt.timeZipAandBwith100Items();
19+
spt.timeZipAandBwithSingleItems();
20+
// spt.timeZipAandBwith100Items();
2121
}
2222
});
2323
} catch (Exception e) {

rxjava-core/src/perf/java/rx/schedulers/TestRecursionMemoryUsage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static void main(String args[]) {
3838
usingFunc2(Schedulers.currentThread());
3939
usingAction0(Schedulers.currentThread());
4040

41-
usingFunc2(Schedulers.threadPoolForComputation());
42-
usingAction0(Schedulers.threadPoolForComputation());
41+
usingFunc2(Schedulers.computation());
42+
usingAction0(Schedulers.computation());
4343
}
4444

4545
protected static void usingFunc2(final Scheduler scheduler) {

0 commit comments

Comments
 (0)