Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Performance problems with large layouts in RCP application
Performance problems with large layouts in RCP application [message #1822735] Thu, 12 March 2020 13:48 Go to next message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 88
Registered: November 2011
Location: Berlin, Germany
Member
Hello,

I asked this question also in the Eclipse 4 forum, but maybe here is the better place.

I'm having some performance problems using large layouts in an RCP application. Consider the following layout snippet:
package test01.test;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class MyLayout {

	public static void main (String [] args) {
		Display display = new Display ();
		Shell shell = new Shell (display);
		shell.setLayout(new FillLayout());
		
		Point size = new Point(2550, 7200);
		
		ScrolledComposite sc = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL);
		sc.setLayout (new FillLayout());
		
		Composite content = new Composite(sc, SWT.NONE);
		content.setLayout(new FormLayout());

		int n = 830;
		int w = size.x - 100;
		int h = size.y - 100;

		FormData data;
		Text text;
		Label label;
		for (int i=0; i<n; i++) {
			text = new Text (content, SWT.BORDER);
			text.setText ("value " + i);
			data = new FormData ();
			data.left = new FormAttachment(0, (int) (Math.random()*w));
			data.top = new FormAttachment(0, (int) (Math.random()*h));
			text.setLayoutData (data);
			if (i < 540) {
				label = new Label(content, SWT.BORDER);
				label.setText("dim");
				data = new FormData ();
				data.bottom = new FormAttachment(text, 0, SWT.BOTTOM);
				data.left = new FormAttachment(text, 0, SWT.RIGHT);
				label.setLayoutData(data);
			}
		}
		
		content.setSize(size);
		sc.setContent(content);
		
		shell.setSize(800, 600);
		shell.open ();

		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ())
				display.sleep ();
		}
		display.dispose ();
	}	
}

This layout has a size of 2550 x 7200 pixels and contains about 1300 children.

When this snipped is run as it is, independent of any RCP application there is no problem.

But if an editor in an RCP application is showing this layout it is extremely slow: it takes several seconds to open, it freezes when it is scrolled and when switching between editors it can even cause the whole application to hang itself.

Where I tested this layout so far:

* 3.x RCP in Eclipse for RCP and RAP Developers
Indigo Service Release 2, Build id: 20120216-1857
=> No Problem

* 3.x RCP in Eclipse for RCP and RAP Developers
2019-09 R (4.13.0), Build id: 20190917-1200
=> slow as described above

* 4.x RCP in Eclipse for RCP and RAP Developers
2019-09 R (4.13.0), Build id: 20190917-1200
=> slow as described above

These RCP applications are based on the corresponding Examples available in the New Project Wizard.

So obviously there are some changes between the Eclipse version from 2012 and 2019 (in between versions not tested), and the question is:

What could cause this performance problem and is there a way to improve it?

I'm happy about any ideas!
Julia

PS: In real live this layout represents a schematic drawing having labels for certain values like temperatures, status messages etc. The above layout just shows a simplified generic example.
Re: Performance problems with large layouts in RCP application [message #1822741 is a reply to message #1822735] Thu, 12 March 2020 14:43 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 876
Registered: January 2012
Senior Member

That's very likely due to the E4 CSS which has to walk the widget tree. IIRC you can disable the CSS entirely with `-cssTheme none` on the command-line.

Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Performance problems with large layouts in RCP application [message #1822779 is a reply to message #1822741] Fri, 13 March 2020 11:18 Go to previous messageGo to next message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 88
Registered: November 2011
Location: Berlin, Germany
Member
Hello Brian,

thanks a lot for your answer!

The '-cssTheme none' command line option works perfectly for the Eclipse 3.x application (64 Bit) on Linux (for the 4.x RCP I don't actually care, just added the test for completeness).

But on Windows it does not make a difference, unfortunately.

The problem seems to be related to a Windows specific plugin, like
org.eclipse.core.filesystem.win32.x86_64
org.eclipse.core.resources.win32.x86_64
org.eclipse.swt.win32.win32.x86_64

The corresponding test application (Eclipse 3.x 64 bit) is attached, if somebody wants to try...

Thanks again!
  • Attachment: test-01.7z
    (Size: 64.13KB, Downloaded 8 times)
Re: Performance problems with large layouts in RCP application [message #1822913 is a reply to message #1822779] Mon, 16 March 2020 16:31 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 179
Registered: April 2012
Senior Member
Hi Julia,

Can you create a bug report for Platform/UI for this performance issue on windows? Also include the test application, to reproduce the issue.
Re: Performance problems with large layouts in RCP application [message #1823037 is a reply to message #1822913] Wed, 18 March 2020 14:12 Go to previous message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 88
Registered: November 2011
Location: Berlin, Germany
Member
OK, thanks Rolf, I'll do so!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=561217

[Updated on: Thu, 02 April 2020 11:28]

Report message to a moderator

Previous Topic:Eclipse Wizard - Back Button event
Next Topic:Is order of application main toolbar elements restorable
Goto Forum:
  


Current Time: Fri Oct 30 05:31:16 GMT 2020

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

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

Back to the top