DESCRIPTION

tmf: Implement a cache of TmfStateValue

This patch provides a caching implementation in the TmfStateValue factory.
TmfStateValue are immutable and can be shared.

By changing the size of the cache, we observed this cache ratio.

size         hit      total     ratio
  2 count:  7369956/15551000 [0.4739216770625683]
  4 count: 11742495/15530000 [0.7561168705730843]
  8 count: 14622383/15545000 [0.9406486330009649]
 16 count: 15007948/15552000 [0.965017232510288]
 32 count: 15372868/15543000 [0.9890541079585665]
 64 count: 15432506/15523000 [0.9941703279005347]
128 count: 15488720/15534000 [0.9970851036436205]

Which seems to be an excellent ratio for a really small cache.
The same idea is used with Integer.valueOf(...).

Change-Id: I3701b900035d83b19531101ab60e7292899d8cef
Signed-off-by: Jordon Obrien xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2013-12-05 18:59:21.000000000

Uploaded patch set 7.

-------------------------------------
author: Jordon Obrien
date: 2013-12-05 19:02:31.000000000

Patch Set 7: Code-Review+1

(1 comment)

lgtm.

Line:121, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statevalue/TmfStateValue.java -> nice catch

-------------------------------------
author: Braxton Mccarthy
date: 2013-12-05 19:04:52.000000000

Patch Set 7: Verified+1 Code-Review+2 IP-Clean+1

> lgtm

That was quick ;)

As you probably noticed, I just added a comment to why it's using .compare() == 0 instead of .equals(), and removed an unneeded temporary variable (that's something Sonar whines about too).

-------------------------------------
author: Brenden Conley
date: 2013-12-05 19:25:04.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4450/

-------------------------------------
author: Brenden Conley
date: 2013-12-05 19:58:23.000000000

Patch Set 7:

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4450/ : SUCCESS

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