DESCRIPTION

Reuse VBucket objects from last Configs to lower GC pressure.

This changeset allows to (optionally) pass in a existing Config
and if VBucket objects are the same, those get reused in the new
Config and not creating new ones all the time. This lowers GC
pressure, especially during rebalance phases when 10 or more
CouchbaseClient objects are used.

Change-Id: If979b5a52ffbcf7e87a4c59bb14f781bf48deaee


COMMENTS

author: Natasha Sullivan
date: 2013-10-30 08:08:54.957000000

Uploaded patch set 2.

-------------------------------------
author: Andreas Short
date: 2013-10-30 16:20:56.565000000

Patch Set 2: Code-Review-2

-2 because there is no test and this is something that should be unit-testable.

I'm okay with this change, though it's not my favorite.  I'd +2 it if it weren't for the test.

Effectively what this does is increase CPU utilization at the time of receiving a configuration by hunting for and reusing some objects.  The current approach uses more space, and the CPU for finding the garbage is handed off to the JVM.

Both things are on a very small scale though, so I'm not too worried about it.

If the real problem is lots of garbage being created, maybe a better solution would be to change the datastructures used underneath and make it mutable with a R/W lock.

But, these are all infrequent, relatively speaking, and small, relatively speaking.  This change preserves as much existing code and avoids creation of lots of little objects by seeking out and reusing the old ones, so it's okay by me.  It's all on a background thread anyway.

-------------------------------------
author: Natasha Sullivan
date: 2013-11-04 12:27:22.768000000

Patch Set 3: Patch Set 2 was rebased

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