DESCRIPTION

JCBC-854: Speed up encoding for RawJsonDocument and StringDocument

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 the raw json document and the string
document. 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 raw json documents and string documents.

Change-Id: Ida5d25f75aeb3445c503cd0abbda538a2b79e8e2


COMMENTS

author: Natasha Sullivan
date: 2015-10-08 13:37:33.772000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2015-10-08 13:37:51.012000000

Patch Set 1: Verified+1

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

Change has been successfully cherry-picked as e89aa7906bdedf7cd97406edf007721774ca676a

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