DESCRIPTION

ctf: Introducing the FixedLengthStringDefintion

This patch introduces the fixedlength 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.

It also offers a cleanup to struct and variant as they now are
scopeddefintions and sequences and arrays can either be
compounddefinitions or fixedlengthstringdefintions.

This patch gives a 20% acceleration in sequential reading.

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


COMMENTS

author: Ivy Mitchell
date: 2014-05-07 03:25:02.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-05-07 03:25:09.000000000

Patch Set 1:

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

-------------------------------------
author: Ivy Mitchell
date: 2014-05-07 03:25:22.000000000

Topic set to CTF performance

-------------------------------------
author: Brenden Conley
date: 2014-05-07 03:36:02.000000000

Patch Set 1: Verified-1

Build Failed 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-05-07 11:57:44.000000000

Patch Set 1:

I will fix this tomorrow, we are now at over a 3x performance increase.

-------------------------------------
author: Kaeden Tapia
date: 2014-05-07 22:06:46.000000000

Patch Set 1:

1719 -> 500ns Ubuntu core i5
3000 -> 900ns OS X core 2 duo

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-14 15:32:14.000000000

Patch Set 1: Code-Review-1

(26 comments)

Looks interesting.

Couple comments.

There are some non-null warnings CtfTmfEventFieldTest. Just make the static final Strings defined in xxx@xxx.xxx

Not sure why we rename SequenceDefinition to CompoundDefinition. There is still a SequenceDeclaration, and no CoumpoundDeclaration?

Line:31, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInput.java -> ctrl+ shift + o

Line:145, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/SequenceDeclaration.java -> spacnig

Line:148, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/SequenceDeclaration.java -> below you put input in definitions.add  If you return here this does not get done. Is this on purpose? If so, then what's the point of doing input.get() here?

Line:289, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java -> ENUM_8 is null. You should make the parameter nullable if you want to make this possible.

Line:23, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDeclarationTest.java -> why?

ctrl+shift+o puts it back the other way

Line:10, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> empty line!

Line:23, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> empty line after

Line:28, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> Defintion, missing a i.  hard to see ;)

Line:31, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> private xxx@xxx.xxx

ohoh transient, we're fancy! ;)

Line:66, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> So we wrote this instead of listening to the guy speaking:

   xxx@xxx.xxx
    public synchronized List<Definition> getDefinitions() {
        List<Definition> defs = fDefs;
        if (defs == null) {
            ImmutableList.Builder<Definition> builder = new ImmutableList.Builder<>();
            for (int i = 0; i < ((ArrayDeclaration) getDeclaration()).getLength(); i++) {
                builder.add(new IntegerDefinition(IntegerDeclaration.UINT_8_DECL, getDefinitionScope(), getFieldName() + '[' + i + ']', fContent.charAt(i)));
            }
           xxx@xxx.xxx
           xxx@xxx.xxx List<Definition> ret = builder.build();
            fDefs = ret;
            return ret;
        }

        return defs;

Line:71, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/FixedStringDefintion.java -> spacing

Line:46, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> ctrl+shift+o

Line:15, /COMMIT_MSG -> use proper capitals, those longwordsarehardtoread

Line:30, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java -> ctrl+shift+o

Line:135, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ArrayDeclaration.java -> spacing

Line:1, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ScopedDefinition.java -> copyright header

Line:45, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ScopedDefinition.java -> why not do (def instanceof ArrayDefinition) ?

Line:88, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ScopedDefinition.java -> same as above

File Comment: lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/SequenceDefinitionTest.java -> Why is this deleted? It does not apply to the new CompoundDefinition?

Line:85, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java -> I don't even feel bad return structures directly now... all praise the Guava

Line:92, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java -> no

Line:108, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java -> no

Line:113, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java -> you should restrict the type at the constructor for this cast to be safe

Line:124, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java -> no no

Line:139, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/CompoundDefinition.java xxx@xxx.xxx String ret on the same line (Luna will format it correctly)

Line:26, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ArrayDefinition.java -> could this be an interface even?

-------------------------------------
author: Ivy Mitchell
date: 2014-05-23 20:58:04.000000000

Patch Set 1:

(1 comment)

Line:26, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/ArrayDefinition.java -> No, as a definition has scope states

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