DESCRIPTION

JVMCBC-456: Basic cleanup of ByteBufJsonParser

Motivation
----------
This changeset adds docblocks and tightens the API scope a little
bit of the parser. It also does one optimization.

Modifications
-------------
Other than tightening the API scope a bit and adding javadocs, this
changeset adds a bigger optimization: it caches the EOFException instead
of creating new ones over and over again.

As it can be seen in
http://normanmaurer.me/blog/2013/11/09/The-hidden-performance-costs-of-instantiating-Throwables/
the problem with using exceptions for flow control is that instantiating
them is expensive and can hurt performance.

Since we don't need a stack trace for flow control, statically creating the exception and reusing
it when throwing it helps to significantly reduce the overhead.

Result
------
Small refactoring and one performance optimization applied to the parser.

Change-Id: I041a441b4572a45a170e28dd75adc30a64b44808


COMMENTS

author: Natasha Sullivan
date: 2017-08-31 13:32:54.632000000

Uploaded patch set 1.

-------------------------------------
author: Hugo Blankenship
date: 2017-08-31 13:33:04.186000000

Patch Set 1:

Build Started http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/57/

-------------------------------------
author: Hugo Blankenship
date: 2017-08-31 13:34:26.990000000

Patch Set 1: Verified+1

Build Successful 

http://sdkbuilds.sc.couchbase.com/job/couchbase-jvm-core-test/57/ : SUCCESS

-------------------------------------
author: Carmen Buckley
date: 2017-08-31 19:36:13.456000000

Patch Set 1: Code-Review+1

(1 comment)

Line:51, src/main/java/com/couchbase/client/core/utils/yasjl/ByteBufJsonParser.java -> Is this another place where it's appropriate to substitute Deque for Stack?

-------------------------------------
author: Natasha Sullivan
date: 2017-09-01 05:22:17.056000000

Patch Set 1:

(1 comment)

Line:51, src/main/java/com/couchbase/client/core/utils/yasjl/ByteBufJsonParser.java -> this is actually one of the two places in the follow-up commit where we change to deque

-------------------------------------
author: Cory Peck
date: 2017-09-01 08:32:06.974000000

Patch Set 1: Code-Review+2

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