DESCRIPTION

JCBC-854: Speed up encoding for String-based document types.

Motivation
----------
Encoding the payload of documents, even if they are already in a String
representation takes time. It pays off if we have faster ways to encode
into a utf8 byte stream.

Modifications
-------------
After some help of JMH and netty utilities, we found a faster way to perform
string encoding. This applies to both quite a few string content based document
types. Separate changes for ID handling will come in too.

Here is a comparison on encoding a 11K json document from string to a
bytebuf:

Benchmark              Mode  Cnt      Score     Error  Units
this    avgt   10  21399.090 ± 331.158  ns/op
2.2.0   avgt   10  79338.532 ± 484.240  ns/op

that is nearly an 4x improvement.

Result
------
Faster encoding performance for string-based document types.

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


COMMENTS

author: Tate Garrett
date: 2015-10-09 08:10:16.763000000

Change has been successfully cherry-picked as e89aa7906bdedf7cd97406edf007721774ca676a

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