DESCRIPTION

JVMCBC-236: Eagerly convert doc id string into bytes.

Motivation
----------
Previously, the core will actually conver the document ID three times
into a utf-encoded byte array:

	- in the key/value locator
	- in the handler to calculate the key length
	- in the codec when the request is encoded

Since 1 is happening on the core thread and 2&3 on the io threads, doing
this repetetive task is quite expensive and generates unnecessary GC.

Modifications
--------------
This changeset encodes it once when the object is created and for now stores
both representations for backwards compatibility.

The locator already uses the byte array and so does the key length calculation
in the handler. In a new changeset also the request encoding will use the new
byte array and then the double storage can be removed (and replaced with a
simple new String(bytes, CharsetUtil.UTF_8) for backwards compat.

Result
------
Less string encoding on the hot code path, less gc and better performance.

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


COMMENTS

author: Gerrit Code Review
date: 2015-08-26 10:51:55.523000000

Change has been successfully cherry-picked as 171f8f298fc2aba533163dd9df81d62106cd5b5e

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