Netflix/RxJava — pull request #1371 by benjchristensen (2014-06-18 00:11:41+00:00)
Title: Backpressure-6: Merge, ObserveOn, SubscribeOn, etc

Mostly functional backpressure with `merge` and `observeOn`.
This is NOT production ready. Need to work on algorithms in merge, data structures and concurrency implementations.

This does not yet have `zip` implemented, and despite effort on performance there are still degradations as shown below.

```
../gradlew benchmarks '-Pjmh=-f 1 -tu s -bm thrpt -wi 5 -i 5 -r 2 -prof GC rx.usecases.*'
```

Performance for 0.19.x vs 0.20 (this branch):

```
Benchmark (size) 0.19 0.20	diff
r.u.PerfBaseline.forLoopConsumption 1 344850705.588 356169426.506	within mean error
r.u.PerfBaseline.forLoopConsumption 1024 304909.309 311743.590	within mean error
r.u.PerfBaseline.iterableViaForLoopConsumption 1 239518717.088 241586374.313	within mean error
r.u.PerfBaseline.iterableViaForLoopConsumption 1024 177090.461 180974.316	within mean error
r.u.PerfBaseline.iterableViaHasNextConsumption 1 302479118.588 307508627.346	within mean error
r.u.PerfBaseline.iterableViaHasNextConsumption 1024 282783.917 287813.401	within mean error
r.u.PerfBaseline.observableConsumption 1 29295739.451 28748055.426	within mean error => 29.2m vs 28.7m, mean error ~0.45m
r.u.PerfBaseline.observableConsumption 1024 233194.851 234253.687	within mean error
r.u.PerfBaseline.observableViaRange 21535829.318
r.u.PerfBaseline.observableViaRange 51645.436
r.u.PerfObserveOn.observeOnComputation 1 378476.870 310228.157	378k vs 310k, mean error ~50k
r.u.PerfObserveOn.observeOnComputation 1024 13122.964 4423.132	WORSE: 13k vs 4k
r.u.PerfObserveOn.observeOnImmediate 1 20465307.041 17203295.323	WORSE: 20.4m vs 17.2m, mean error ~800k
r.u.PerfObserveOn.observeOnImmediate 1024 232424.832 51503.696	WORSE: 232k vs 51k
r.u.PerfObserveOn.observeOnNewThread 1 20209.183 20055.322	within mean error
r.u.PerfObserveOn.observeOnNewThread 1024 10170.748 4224.503	WORSE: 10k vs 4k
r.u.PerfTransforms.flatMapInt 1 3308740.889 2404699.223	WORSE: 3.3m vs 2.4m
r.u.PerfTransforms.flatMapInt 1024 6522.641 3053.996	WORSE: 6.5k vs 3.0k
r.u.PerfTransforms.flatMapNestedMapFilterTake 1 2150209.920 1777010.078	WORSE: 2.1m vs 1.8m, mean error ~60k
r.u.PerfTransforms.flatMapNestedMapFilterTake 1024 15.943 80.803	BETTER: 15 vs 80, mean error ~3
r.u.PerfTransforms.mapIntStringInt 1 9107565.666 9004589.569	within mean error
r.u.PerfTransforms.mapIntStringInt 1024 18774.750 15238.517	WORSE: 18.7k vs 15.2k, mean error ~500
r.u.PerfTransforms.mapPassThru 1 19336755.193 15719416.479	WORSE: 19.3m vs 15.7m, mean error ~500k
r.u.PerfTransforms.mapPassThru 1024 199751.628 49089.139	WORSE: 200k vs 49k
```