anjlab / eclipse-tapestry5-plugin

Eclipse Plugin for Tapestry5
Apache License 2.0
21 stars 9 forks source link

Plugin makes eclipse extremely slow in some projects #18

Closed micw closed 10 years ago

micw commented 10 years ago

On my linux machine, eclipse is very slow in some projects when the plugin (at least "basic" support) is installed. When I start eclipse, it response very fast. After a while the plugin is analyzing my project. When it is done, all editors (including imple text editor) response extremely slow, especially when marking text with Shift+Cursor keys.

I have verified that the problem disappears as soon as I uninstall the plugin. Happens on Eclipse 4.3 as well es 4.4 (instaleld today). The problem occured also in older versions of the plugin (i startet to use it on my linux box starting with version 2.3.x or so).

dmitrygusev commented 10 years ago

That's odd, the plugin does nothing with Shift+Cursor and text selections.

I know that some parts of it are slow, like this one with HyperlinkDetectors: https://github.com/anjlab/eclipse-tapestry5-plugin/blob/04d02ae534da4c32030cb4b13965166727b65364/com.anjlab.eclipse.tapestry5/src/com/anjlab/eclipse/tapestry5/hyperlink/TapestryComponentHyperlinkDetector.java#L75

But that may only affect you when you CMD+hover over the TML.

The plugin indeed consumes some memory (maybe more than it should -- I've never optimized that), but maybe you should just add more heap to the Eclipse? Below is my eclipse.ini, I remember I tuned it, but don't remember what exactly. I'm sure I changed -Xms and -Xmx, but probably something else, like GC:

✗ cat /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Xverify:none
-XX:+UseG1GC
-XX:-DontCompileHugeMethods
-XX:MaxInlineSize=1024
-XX:FreqInlineSize=1024
-Djavax.net.ssl.trustStore=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts
-Djavax.net.ssl.trustStorePassword=changeit
-Dosgi.requiredJavaVersion=1.6
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xms2G
-Xmx2G
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

I'm using

Version: Kepler Service Release 2
Build id: 20140224-0627

I haven't switched to Luna yet, but glad you posted this issue, because I'd forgot to migrate these settings too.

micw commented 10 years ago

I did some profiling. There are 2 hotspots while the selection changes. This is not a problem when selecting with the mouse (any maybe not a problem on windows?) because the events are fired only a few times. When using the keyboard, the events are fired rapidly.

(attached as image in next comment)

micw commented 10 years ago

bildschirmfoto-local attach - jprofiler 8 0 7

dmitrygusev commented 10 years ago

Ohh, I see... that helps. We don't have to handle selectionChanged events for text selections there, because these selections won't affect current project/context.

Hopefully simple check for selection instanceof ITextSelection should be enough to skip such events. Or maybe we should only handle ITreeSelection? I will try to improve this stuff, hopefully it won't take long.

Thanks again for profiling results.

dmitrygusev commented 10 years ago

Should be fixed in 2.4.6

micw commented 10 years ago

I have tested it and can confirm that it is fixed. Thank you a lot!!!