DESCRIPTION

JVMCBC-303: Optimize scheduling for CoreScheduler

Motivation
----------
Right now the code moves the response away from the IO pool
onto the computation pool for security. It does this by creating
a worker, dispatching the request and then unsubscribing after
the fact.

Modifications
-------------
There is some GC overhead in worker creation and thankfully the
CoreScheduler provides a quick way to immediately schedule an
Action without having to create the worker wrapper around it.

This gives the same performance, but avoids Worker allocations
on every request.

Since this method is not on the Scheduler interface, a branch
is introduced which checks if the optimization is possible and
if so applies it.

Result
------
Less object allocations in the hot code path.

Change-Id: I9435b97dfab4092d3418a7730d792288dae98180
Reviewed-on: http://review.couchbase.org/60855
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2016-03-03 14:56:05.478000000

Change has been successfully cherry-picked as 6d238b0d6e8bddddb64e0eb99faece4115daa72d

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