DESCRIPTION

[TMF] Optimize TimeGraphControl.drawState() method.
Gain on Linux after optimization is about 25%.

Change-Id: I0ff437c0d4ba832de73d6deb04c381015393617d
Signed-off-by: Bryce Kline xxx@xxx.xxx


COMMENTS

author: Bryce Kline
date: 2014-01-09 10:36:22.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-01-09 10:36:27.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2014-01-09 11:12:08.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Luciana Barry
date: 2014-01-10 21:37:17.000000000

Patch Set 2: Code-Review-1

(6 comments)

Nice optimization!

Line:7, /COMMIT_MSG -> Must have empty line between title and comments.

Line:1683, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> I suggest we store the black Color as a static final constant.

Line:1692, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> foreground is already black

Line:1707, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> If we use drawRectangle instead we won't have to set the background (it will draw with foreground color -- already black). But we would need to subtract 1 from width and height.

Line:1711, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> spaces around + and -

Line:1712, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> If doing 2 drawing operations instead of 3 per state has a big performance improvement, why not do only 1? I tried it by removing completely the 'if' clause and always executing the 'else' clause. It changes the general 'look' of the graph... more colorful... more iOS 7-like... Anyways perhaps drawing performance is more important than appearance preference. We do lose the 'highlight' of the selected state, not that I miss is really, but if we still want it, we can do 1 extra operation to add white or gray top/bottom borders. It would be done only for one state in the whole graph, instead of now where the extra drawing operation is done for all states except one.

-------------------------------------
author: Luciana Barry
date: 2014-01-10 21:39:09.000000000

Patch Set 2:

(2 comments)

Line:1, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> 2014

Line:15, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Add yourself

-------------------------------------
author: Bryce Kline
date: 2014-01-14 09:18:14.000000000

Patch Set 2:

(8 comments)

thanks Patrick for your feedback.
Please find my answers below.

Line:7, /COMMIT_MSG -> Done

Line:1, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Done

Line:15, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Done

Line:1683, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Today, this class can be created from any thread. If we store the black Color as a static final constant, this class can be created only from UI thread.
Are you OK for that ?

Line:1692, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Done

Line:1707, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> So? What do you prefer ?

Line:1711, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Done

Line:1712, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Done

-------------------------------------
author: Gerrit Code Review
date: 2014-01-17 08:28:18.000000000

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

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

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