Critical Performance issue with 2.1.1


We have profiled our Tomcat server because we were facing performance issues when querying a ViewQuery which emits a JsonArray with a long inside. It happened that when emitting a long value (timestamp) as part of an array key, the couchbase java client spends a lot of time throwing JsonParseException when trying to read an int, catching them and reading a long value instead.

The profiler has shown that this consumes 70% of our cpu time in JacksonTransformers$AbstractJsonValueDeserializer.decodeObject(), line 65:

try {
  target.put(field, parser.getValueAsInt());
} catch (final JsonParseException e) {
  target.put(field, parser.getValueAsLong());

You can reproduce by emitting any JsonArray with a long as part of a view key.

Hi @vanadium,

thanks much for reporting that. I’ve created a JIRA task to track it:

Maybe jackson provides us better facilities to handle that case. I’ll try to tackle it soon so we can get it into the next bugfix release. Are you good with following the JCBC ticket?

Thanks, it’s perfectly fine for me to follow the issue on your tracker. :slight_smile:

As a work around, we are going to switch to relative timestamp which should not overflow integer value at the moment. As soon as the fix is available, we will upgrade the Java client.

We’re collecting some JMH perf numbers to be sure, but it’s looking good for a 2.1.2:

Great, 3x faster! Well done. Can’t wait to get the 2.1.2 running on our servers.

2.1.2 is planned for 7th April (we do releases every first tuesday of the month) until something critical comes up, so you can plan ahead.


we’ve published a developer preview of 2.1.2 to get quicker feedback if the bug is properly fixed and your issues are addressed. You can get it from our couchbase repository like all pre-releases, the 2.1.2 GA release will be published to maven central as usual.

You can get it like this:


        <name>couchbase repo</name>

Keep in mind that this is not an officially tested release since it has not gone trough extensive QE testing yet. Please let us know if it works and upgrade to 2.1.2 as soon as it is released.



I’m quite busy at the moment with others tasks, i may not have chance to give you a feedback on this issue until the public 2.1.2 release. Anyway, thanks for being so “reactive”!

No problem at all, the developer preview has been released since some other issues were also reported and we can get quick feedback from the reporters.