DESCRIPTION

tmf: add subfield filtering

Change-Id: I4e7b8ba2ffaf99d95639129ac8b33f673d0673e9
Signed-off-by: Itzel Singleton xxx@xxx.xxx


COMMENTS

author: Itzel Singleton
date: 2014-07-18 21:51:45.000000000

Uploaded patch set 1.

-------------------------------------
author: Itzel Singleton
date: 2014-07-18 21:56:11.000000000

Patch Set 1:

Based on commit Idcb1429a73d4fe981aa644126cc95f886e6a736e which added two features. I think it is better to merge those separately, which is why this is a new commit.

-------------------------------------
author: Ivy Mitchell
date: 2014-07-18 23:10:31.000000000

Patch Set 1: Code-Review-1

(7 comments)

I like this, but it may be a bit slow on the fast path... 
please consider my code :)

Line:257, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/Messages.java -> no line please

Line:34, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> nice regex!

Line:151, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> READ ME FIRST!!! 
In terms of performance, as you are filtering on a char and not a string, the following code is  3-4x faster
<code>
StringBuilder sb = new StringBuilder();
    List<String> l = new ArrayList<>();
    for (int i = 1; i < field.length(); i++) {
      final char charAt = field.charAt(i);
      if (charAt == slash) {
        final boolean b = field.charAt(i - 1) != slash;
        if (((field.length() != i + 1) && (field.charAt(i + 1) != slash))
            && b) {
          l.add(sb.toString());
          sb = new StringBuilder();
        }
        if (b) {
          continue;
        }
      }
      sb.append(charAt);
    }
    l.add(sb.toString());</code>

Line:152, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> constant please

Line:155, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> split but don't have a first element. Maybe comment this, it's quite awesome.

Line:157, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> Is this supposed to be a constant too?

Line:165, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/filter/model/TmfFilterTreeNode.java -> don't need this for future reference

-------------------------------------
author: Ivy Mitchell
date: 2014-07-18 23:21:00.000000000

Patch Set 1:

After testing, my code is approx 7 times faster on large strings  ( 136 elems) and 4x faster on shorter strings (16 elems).

-------------------------------------
author: Ivy Mitchell
date: 2014-07-19 01:23:30.000000000

Patch Set 1:

Is this in the fast path (executed per event?) or in the slow path (run once?)

-------------------------------------
author: Brenden Conley
date: 2014-07-19 01:33:04.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-07-19 02:23:38.000000000

Patch Set 1: Verified-1

Build Failed 

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

-------------------------------------
author: Itzel Singleton
date: 2014-07-19 04:32:37.000000000

Patch Set 1:

Awesome suggestion! This is on the fast path so this will make filtering on subfields much faster! I'll submit a new patch on monday!

-------------------------------------
author: Gerrit Code Review
date: 2014-07-24 13:55:01.000000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

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