DESCRIPTION

tmf: Make TmfLocationArray really immutable

Also save one copy when creating the array of locations for a
'null' location (indicating the beginning of the trace).

Change-Id: Icac83f510175f0ab2b1bf44ccec06a1f354250b6
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-04-07 20:28:59.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-04-07 20:52:08.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-04-07 21:26:43.000000000

Patch Set 1: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6282/ : FAILURE

-------------------------------------
author: Brenden Conley
date: 2014-04-08 20:43:39.000000000

Patch Set 1: -Verified

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

-------------------------------------
author: Brenden Conley
date: 2014-04-08 21:33:45.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-04-09 19:54:31.000000000

Patch Set 1:

Could you prove this is better than the previous patch? memory/cpu/other?

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-09 19:58:56.000000000

Patch Set 1:

> Could you prove this is better than the previous patch? memory/cpu/other?

Define "better" ;) It's a bit less LoCs while preserving functionality, and imo cleaner (the implementation actually matches the Javadoc now).

I didn't do exhaustive performance tests, but running the series of TmfExperimentTests, in both cases each version (this and master) took between 2 and 2.5 secs to run each test. So I'd assume performance shouldn't be affected much.

-------------------------------------
author: Ivy Mitchell
date: 2014-04-09 20:59:50.000000000

Patch Set 1: Code-Review-1

This commit slows down read time by log(n) time for experiments
please tale a look at the results here http://imgur.com/a/eQOXK

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-09 23:27:51.000000000

Patch Set 1:

+1 on the review itself, nice chart ;)

Yeah this patch was more about bringing the implementation inline with what the doc says. But I think here immutable might not be the best option, since we create the object, use it once to seek the experiment, and then throw it away to build another location from it (using that silly copy-but-change-one-entry constructor ;) ), which completely negates the usefulness of using immutable objects.

So, reworking this part to use less objects, less allocations, but mutable objects (while being careful with synchronization etc.) would probably the better long-term solution.

-------------------------------------
author: Braxton Mccarthy
date: 2014-04-16 22:42:26.000000000

Abandoned

"really mutable" would be better in this case

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