Bug 249915 - [Dialogs] TitleAreaDialog does not short circuit if message is null
Summary: [Dialogs] TitleAreaDialog does not short circuit if message is null
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.6 M3   Edit
Assignee: Susan McCourt CLA
QA Contact: Susan McCourt CLA
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2008-10-07 04:44 EDT by Tim Moore CLA
Modified: 2009-10-27 13:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Moore CLA 2008-10-07 04:44:16 EDT
M20080911-1700

When profiling use of a custom WizardDialog on Linux/GTK, a lot of time was spent in WizardPage.setMessage(...). It turns out that this was because we were setting a message of null after each keypress, and the page's description (DialogPage.getDescription()) was also null. In this case the short-circuit in TitleAreaDialog.setMessage(String, int) fails to notice that the message has not changed, and does a layout every time.
For our dialog this takes about 40ms each time, which is noticeable when compounded with other work.
Comment 1 Susan McCourt CLA 2009-07-09 18:19:55 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 2 Susan McCourt CLA 2009-09-28 19:51:26 EDT
Good catch.  Fixed in HEAD >20090928.

I spent some time trying to build an automated regression test for this, but I had trouble demonstrating the problem in a test using public API.  There's no hook to count the extra layouts and all the relevant methods in TitleAreaDialog are private, so the test case couldn't hook them to prove that the extra layout computations were happening.  You can't count resizes because SWT ultimately decides that no resize is required.

I stepped through the code to prove that the fix does indeed short circuit the layout now, so that is going to have to be good enough.
Comment 3 Susan McCourt CLA 2009-10-27 13:19:56 EDT
verified on WinXP, Build id: I20091027-0100 through source inspection