DESCRIPTION

JVMCBC-128: Avoid observeOn on the hot code path.

Motivation
----------
Using observeOn for every request adds significant latency and GC,
since lots of stuff is done in the background. In order to reduce
latency on the hot code path, the observeOn should be removed.

Modifications
-------------
Since we still need to move off the subscriber to a different
pool, a worker is utilized to complete the subject right from
this pool without going through the observeOn slowness.

Another optimization has been put into place so that non-retry
responses are completed from the IO thread, without the need
to even go through the response handler too. Note that for
safety reasons inside the response handler the same scheduling
mechanisms have been put into place.

Finally, the retry handling always used the same worker and it
is now using a (acked by the rx team) way to schedule tasks
on the worker.

Result
------
Faster execution on the hot code path. on a single-threaded
get loop this gives us a boost of 1k ops/s and less GC.

Change-Id: I712c45a8bb0b69efa75f02baaeeb244b5ab7c15b
Reviewed-on: http://review.couchbase.org/45472
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Cory Peck xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2015-01-19 07:39:46.790000000

Change has been successfully cherry-picked as 4c1ab6e4983f05174d57ed90c17fcb48edcca99c

-------------------------------------
