SWT GridLayout and Performance Issue [message #129932] |
Tue, 15 August 2006 16:36  |
Eclipse User |
|
|
|
Hello again,
I have a question on the performance of VE this time.
We have a visual class, which extends SWT Composite and found it took a
long time just to load the class.
We could guess the main cause of this performance issue: Our class is
considerably complicated. The number of grids (columns * rows) is about
2,000 and the number of widgets on the Composite is about 100.
Although we know that performance would be improved by reducing number
of grids or widgets, we would like to keep the class as it is if
possible because there is no noticable performance problem at runtime.
Are there any special tips to improve performance without changing the
class?
Tami
|
|
|
Re: SWT GridLayout and Performance Issue [message #130122 is a reply to message #129932] |
Thu, 17 August 2006 23:10  |
Eclipse User |
|
|
|
I did some research and found a way to improve loading performance. It
was nothing related to SWT GridLayout.
Previously, child widgets were instantiated in initialize() method, i.e.
our previous initialize() method was like:
GridData gridData;
Label label1 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 1;
label1.setText(" ");
gridData.verticalSpan = 1;
label1.setLayoutData(gridData);
Label label2 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 20;
label2.setText(" ");
gridData.verticalSpan = 1;
label2.setLayoutData(gridData);
Label label3 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 1;
label3.setText(" ");
gridData.verticalSpan = 1;
label3.setLayoutData(gridData);
After I moved each child widget initiantiation to individual method,
i.e. I re-wrote initiailize() to
createLabel1();
createLabel2();
createLabel3();
and moved initividual initialization code to each method, the loading
performance was greatly improved.
It seems like the lengths of the methods, where child widgets are
instantiated, are a big factor on the performance in loading a visual
class on VE. Interesting.
Tami
|
|
|
Re: SWT GridLayout and Performance Issue [message #614556 is a reply to message #129932] |
Thu, 17 August 2006 23:10  |
Eclipse User |
|
|
|
I did some research and found a way to improve loading performance. It
was nothing related to SWT GridLayout.
Previously, child widgets were instantiated in initialize() method, i.e.
our previous initialize() method was like:
GridData gridData;
Label label1 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 1;
label1.setText(" ");
gridData.verticalSpan = 1;
label1.setLayoutData(gridData);
Label label2 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 20;
label2.setText(" ");
gridData.verticalSpan = 1;
label2.setLayoutData(gridData);
Label label3 = new Label(this, 0);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 1;
label3.setText(" ");
gridData.verticalSpan = 1;
label3.setLayoutData(gridData);
After I moved each child widget initiantiation to individual method,
i.e. I re-wrote initiailize() to
createLabel1();
createLabel2();
createLabel3();
and moved initividual initialization code to each method, the loading
performance was greatly improved.
It seems like the lengths of the methods, where child widgets are
instantiated, are a big factor on the performance in loading a visual
class on VE. Interesting.
Tami
|
|
|
Powered by
FUDForum. Page generated in 0.03628 seconds