|
Re: SWT GridLayout and Performance Issue [message #130122 is a reply to message #129932] |
Fri, 18 August 2006 03:10 |
Tami Takamiya Messages: 28 Registered: July 2009 |
Junior Member |
|
|
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] |
Fri, 18 August 2006 03:10 |
Tami Takamiya Messages: 28 Registered: July 2009 |
Junior Member |
|
|
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.24355 seconds