Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » SWT GridLayout and Performance Issue
SWT GridLayout and Performance Issue [message #129932] Tue, 15 August 2006 20:36 Go to next message
Tami Takamiya is currently offline Tami TakamiyaFriend
Messages: 28
Registered: July 2009
Junior Member
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] Fri, 18 August 2006 03:10 Go to previous message
Tami Takamiya is currently offline Tami TakamiyaFriend
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 Go to previous message
Tami Takamiya is currently offline Tami TakamiyaFriend
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
Previous Topic:AWT/Swing application
Next Topic:AWT/Swing application
Goto Forum:
  


Current Time: Fri Apr 26 15:58:28 GMT 2024

Powered by FUDForum. Page generated in 0.24355 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top