DESCRIPTION

ctf: Introducing the FixedLengthStringDefintion

This patch introduces the fixed-length string that will make sequences
and arrays read faster when it's a string, as the CTF spec specifies
that they are aligned on 8 bits and always 8 bits wide per character.

Sequences and arrays can either be ArrayDefinitions or
ByteArrayDefintions.

This patch gives a 20% acceleration in sequential reading.

Signed-off-by: Ivy Mitchell xxx@xxx.xxx
Change-Id: I7933268b7f9271f74f7d59339ea9b8343fdb021e


COMMENTS

author: Ivy Mitchell
date: 2014-06-18 20:39:33.000000000

Uploaded patch set 12.

-------------------------------------
author: Braxton Mccarthy
date: 2014-06-18 22:40:19.000000000

Patch Set 12: Code-Review-1

(6 comments)

Line:7, /COMMIT_MSG -> doesn't exist anymore

second paragraph should be updated too

Line:41, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> same line

put it after fLength (since this one is not final)

Line:82, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> same line

Line:97, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> if you keep this, why not just return AOOBE all the time (in fact just do .get(i), Collection already does this check).

Line:115, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> You could define the array with the ?: check on a separate line, makes it clearer.

Creating a String + a new array *every* time this method is called seems heavy. How about saving the String in a lazy-loaded class field?

Line:62, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/AbstractArrayDefinition.java -> You should have either:

  Collection<Definition> getDefinitions()

or

  Defintion getDefintion(int index)
  int getSize();

in the interface. But having the two sets of APIs is redundant. Since you're using Immutable collections, I'd lean towards the former.

-------------------------------------
author: Brenden Conley
date: 2014-06-19 00:47:25.000000000

Patch Set 12:

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

-------------------------------------
author: Brenden Conley
date: 2014-06-19 01:34:47.000000000

Patch Set 12: Verified+1

Build Successful 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-06-19 13:48:38.000000000

Patch Set 12:

(5 comments)

Line:41, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> Done

Line:82, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> Done

Line:97, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> Done

Line:115, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/ByteArrayDefinition.java -> Done

This is not much heavier than return name + "=" + Integer.toString(value);... I think. If it's a performance issue, let's make it another patch.

Line:62, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/AbstractArrayDefinition.java -> Done

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