Netflix/RxJava — pull request #724 by benjchristensen (2014-01-06 21:28:54+00:00)
Title: Revert use of CurrentThreadScheduler for Observable.from

Use ImmediateScheduler as performance is 4x faster and CurrentThreadScheduler currently offers no benefit (it doesn’t solve the unsubscribe problem).

Performance numbers:

* Observable.from(Arrays.asList(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), scheduler);
*
* --- Schedulers.immediate() ---
*
* Run: 0 - 1,849,947 ops/sec
* Run: 1 - 2,076,067 ops/sec
* Run: 2 - 2,114,688 ops/sec
* Run: 3 - 2,114,301 ops/sec
* Run: 4 - 2,102,543 ops/sec
*
* --- Schedulers.currentThread() ---
*
* Run: 0 - 548,862 ops/sec
* Run: 1 - 559,955 ops/sec
* Run: 2 - 581,412 ops/sec
* Run: 3 - 562,187 ops/sec
* Run: 4 - 565,723 ops/sec

* Observable.from(Arrays.asList(1L), scheduler);
*
* --- Schedulers.immediate() ---
*
* Run: 10 - 4,113,672 ops/sec
* Run: 11 - 4,068,351 ops/sec
* Run: 12 - 4,070,318 ops/sec
* Run: 13 - 4,161,793 ops/sec
* Run: 14 - 4,156,725 ops/sec
*
* --- Schedulers.currentThread() ---
*
* Run: 10 - 1,692,286 ops/sec
* Run: 11 - 1,765,054 ops/sec
* Run: 12 - 1,763,100 ops/sec
* Run: 13 - 1,770,907 ops/sec
* Run: 14 - 1,732,291 ops/sec