Bug 527103 - [Win32] Performance regression on Tree.setLinesVisible(boolean)
Summary: [Win32] Performance regression on Tree.setLinesVisible(boolean)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 4.7.2   Edit
Assignee: Conrad Groth CLA
QA Contact: Niraj Modi CLA
URL:
Whiteboard:
Keywords:
Depends on: 510728
Blocks:
  Show dependency tree
 
Reported: 2017-11-10 04:58 EST by Jussi Koskela CLA
Modified: 2017-11-16 04:48 EST (History)
8 users (show)

See Also:
niraj.modi: review+
lshanmug: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jussi Koskela CLA 2017-11-10 04:58:55 EST
Calling tree.setLinesVisible(true) invalidates and redraws all application windows if tree.hwndHeader has not been initialized internally. This may cause delay of 1-2 seconds.

The problem is reproducible with the folloing code:

Tree tree = new Tree(parent, SWT.SINGLE);
tree.setLinesVisible(true);

In the current implementation OS.InvalidateRect (hwndHeader, null, true) is called even if the hwndHeader has not been initialized (=0).

org.eclipse.swt.widgets.Tree

public void setLinesVisible (boolean show) {
	checkWidget ();
	if (linesVisible == show) return;
	linesVisible = show;
	if (hwndParent == 0 && linesVisible) customDraw = true;
	OS.InvalidateRect (handle, null, true);
	OS.InvalidateRect (hwndHeader, null, true);
}

The regression seems to have been introduced in:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/bundles/org.eclipse.swt/Eclipse%20SWT/win32/org/eclipse/swt/widgets/Tree.java?id=d1079d72b176966ee4a60ab951c7687ce3123562
Comment 1 Dani Megert CLA 2017-11-12 11:11:50 EST
Conrad, can you have a look?
Comment 2 Eclipse Genie CLA 2017-11-12 13:20:05 EST
New Gerrit change created: https://git.eclipse.org/r/111431
Comment 4 Niraj Modi CLA 2017-11-15 06:21:20 EST
(In reply to Eclipse Genie from comment #3)
> Gerrit change https://git.eclipse.org/r/111431 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=10b170d938a52aa9095ae6e358b12471ed7ad944

Above addresses the performance regression reported in comment 0.
Verified the fix in latest Eclipse Build id: I20171115-0115
Comment 5 Niraj Modi CLA 2017-11-15 06:30:08 EST
Being a performance regression bug and the fix is straight forward, hence considering it for back-port to 4.7.2
Comment 6 Eclipse Genie CLA 2017-11-15 06:32:41 EST
New Gerrit change created: https://git.eclipse.org/r/111619
Comment 8 Niraj Modi CLA 2017-11-15 08:03:00 EST
(In reply to Eclipse Genie from comment #7)
> Gerrit change https://git.eclipse.org/r/111619 was merged to
> [R4_7_maintenance].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=3158cee8fcdcf63868233c52d34e491637e77634

Resolving now, next 4.7.2 M-Build should have this fix.
Comment 9 Niraj Modi CLA 2017-11-16 04:48:41 EST
Verified the fix with Build id: M20171115-1700 & I20171115-0115 on Win7.