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


COMMENTS

author: Natasha Sullivan
date: 2015-01-16 20:10:46.679000000

Uploaded patch set 2.

-------------------------------------
author: Natasha Sullivan
date: 2015-01-16 20:56:35.319000000

Patch Set 2: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2015-01-16 22:12:51.689000000

Patch Set 2: Code-Review+2

(1 comment)

see comment on commit message

Line:27, /COMMIT_MSG -> doesn't the code create a new Worker every time?

-------------------------------------
author: Cory Peck
date: 2015-01-19 07:20:01.395000000

Patch Set 2: Code-Review+2

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