Bug 497175 - Java Editor reacts very slow / laggy on large source files in Eclipse Neon
Summary: Java Editor reacts very slow / laggy on large source files in Eclipse Neon
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-02 03:08 EDT by Michael Stiefler CLA
Modified: 2018-06-10 15:41 EDT (History)
2 users (show)

See Also:


Attachments
Slow Java Editor in Neon Stack Trace 2016-07-02 (33.03 KB, text/plain)
2016-07-02 03:08 EDT, Michael Stiefler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stiefler CLA 2016-07-02 03:08:29 EDT
Created attachment 262872 [details]
Slow Java Editor in Neon Stack Trace 2016-07-02

When working on large (>10000 lines) Java source files, the reaction of the Editor in Eclipse Neon becomes extremely slow whenever you change something.
It doesn't depend on the type of change.
Typing a character takes a second to show it.
Marking some block of text takes a second to show up.
Adding / removing comment blocks takes a second to show up.

"A second" depends on the machine Eclipse is running on.
For instance on an i5-2500K machine this was about a second usually, on an i7-920 it could as well take 5 seconds each.

Stack trace is attached.

PC Config:
i5-2500K, Win7, 8GB RAM, 256GB SSD, 2TB HDD.
6GB free, no swapping.

Eclipse config:
-Xms512m
-Xmx1024m
-server
-XX:+UseParallelGC
-Xverify:none
-Dcom.sun.management.jmxremote

Java Version: Oracle JDK 1.8.0-92

Steps to reproduce:
Open a large (>10000 lines) Java source file and have fun...

Best regards - Mike
Comment 1 Stephan Herrmann CLA 2016-07-02 07:51:33 EDT
Pasting below what looks like the only relevant activity. I would be good to confirm this with a few more samples to see how much of this stack is unchanged over time (perhaps activity in AnnotationRulerColumn is) vs. incidental just in this snapshot (e.g.,: is BiDi processing relevant?).

Did you have lots of annotations/markers in that file? Errors/warnings/info? TODOS? etc... ("Information" markers in Java files are new in Neon). Here "annotation" refers to how markers are rendered in the UI, not to confuse with Java annotations.

To investigate the impact of annotations: please deselect relevant annotations in Preferences > General > Editors > Text Editors > Annotations, and see if that significantly improves performances. All three check boxes below "Show in" might be relevant.

As you mention that this is a regression in Neon: the only JDT class on this stack, JavaSourceViewer, hasn't seen any relevant code changes in Neon... so if it's not the number of annotations, maybe s.t. in SWT or JFace has changed?



"main" #1 prio=6 os_prio=0 tid=0x0000000002bee800 nid=0xdcc runnable [0x000000000012d000]
   java.lang.Thread.State: RUNNABLE
	at com.ibm.icu.text.Bidi.setPara(Bidi.java:4042)
	at com.ibm.icu.text.Bidi.<init>(Bidi.java:5373)
	at com.ibm.icu.text.Bidi.<init>(Bidi.java:5260)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.getBidiLineSegments(JavaSourceViewer.java:580)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer$1.lineGetSegments(JavaSourceViewer.java:480)
	at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:43)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:802)
	at org.eclipse.swt.custom.StyledText.sendLineEvent(StyledText.java:8254)
	at org.eclipse.swt.custom.StyledText.getBidiSegments(StyledText.java:4850)
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:784)
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:714)
	at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:211)
	at org.eclipse.swt.custom.StyledTextRenderer.getLineHeight(StyledTextRenderer.java:563)
	at org.eclipse.swt.custom.StyledText.getLinePixel(StyledText.java:4265)
	at org.eclipse.jface.text.JFaceTextUtil.getLinePixel(JFaceTextUtil.java:285)
	at org.eclipse.jface.text.JFaceTextUtil.computeLineHeight(JFaceTextUtil.java:79)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.doPaint1(AnnotationRulerColumn.java:814)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.doubleBufferPaint(AnnotationRulerColumn.java:555)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.redraw(AnnotationRulerColumn.java:857)
	at org.eclipse.jface.text.source.AnnotationRulerColumn$8.run(AnnotationRulerColumn.java:842)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	- locked <0x00000000fcc369f0> (a org.eclipse.swt.widgets.RunnableLock)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4203)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3819)
Comment 2 Norbert Sándor CLA 2018-06-09 07:52:14 EDT
I have similar problem running on Ubuntu Linux (latest LTS) + Eclipse Photon (latest milestone).
The (legacy) file has 16k+ lines and every operation/keypress takes some seconds (on a fast Ryzen 7 1700 based PC).
Comment 3 Norbert Sándor CLA 2018-06-10 06:48:27 EDT
(In reply to Norbert Sándor from comment #2)
> I have similar problem running on Ubuntu Linux (latest LTS) + Eclipse Photon
> (latest milestone).
> The (legacy) file has 16k+ lines and every operation/keypress takes some
> seconds (on a fast Ryzen 7 1700 based PC).

In my case it was caused by lombok.
After I removed it from the project, the performance of Eclipse has become OK again.
Comment 4 Dani Megert CLA 2018-06-10 15:41:01 EDT
Please reopen if you see this in http://download.eclipse.org/eclipse/downloads/drops4/S-4.8RC4-201806071630/ or newer.