Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355401 - Problem with printers: Slow speed/performance when selecting/de-selecting nodes
Summary: Problem with printers: Slow speed/performance when selecting/de-selecting nodes
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno M2 Theme_bugs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 11:04 EDT by Ivar Refsdal CLA
Modified: 2012-06-28 10:40 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivar Refsdal CLA 2011-08-22 11:04:43 EDT
Build Identifier: 20110301-1815

Graphiti appears to be very slow because of SWT printer problems.

The following exception happened a few times:
java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part org.eclipse.ui.navigator.ProjectExplorer while still in the middle of activating part org.eclipse.ui.views.ProblemView
Full stacktrace at: http://pastebin.com/NiSff2Mf

The problem is the following:
>  at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238)
>     at org.eclipse.swt.internal.gtk.OS._gtk_enumerate_printers(Native Method)
>     at org.eclipse.swt.internal.gtk.OS.gtk_enumerate_printers(OS.java:9091)
>     at org.eclipse.swt.printing.Printer.getPrinterList(Printer.java:91)
>     at org.eclipse.gef.ui.actions.PrintAction.calculateEnabled(PrintAction.java:45)
>     at org.eclipse.graphiti.ui.internal.action.PrintGraphicalViewerAction.calculateEnabled(PrintGraphicalViewerAction.java:98)

Printer.getPrinterList() gets called over and over again, at least once for each node one selects. And this getPrinterList function happens to be very slow on my setup (see the end), and thus the Graphiti-based editor also appears very slow.
Simply returning false cures the problem. Obviously caching the correct return value would be a good solution.

If one chooses "print" from Eclipse,
the dialog where one chooses the printer is also very slow,
but as far as I know this hasn't affected any of the other plugins notably,
and also it doesn't crash. 

Setup:
$ cat /proc/version
Linux version 2.6.18-274.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Fri Jul 8 17:36:59 EDT 2011
$ java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

There's quite a few printers available (20-30) at this uni, so the setup is somewhat special. These were also in frequent use at this time.

Reproducible: Always
Comment 1 Michael Wenz CLA 2011-08-29 06:28:17 EDT
From the original forum entry:
The OS is:
> $ cat /proc/version
> Linux version 2.6.18-274.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc
> version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Fri Jul 8 17:36:59 EDT 2011
Comment 2 Matthias Gorning CLA 2011-09-14 09:23:25 EDT
Fixed. From now on the result whether a printer is available or not will cached.
Comment 3 Michael Wenz CLA 2012-04-11 10:32:48 EDT
Bookkeeping: Set target release
Comment 4 Michael Wenz CLA 2012-06-28 10:40:36 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)