Community
Participate
Working Groups
Created attachment 244540 [details] Code to paste Kepler SR2 Build: 20140224-0627 + PDT 3.3.0.201406251911 (3.3-nightly) Pasting ~2000 lines of code takes ~20000 sec. To reproduce: * Create new php file with only "<?php ?>" * Paste code from attachment into php block Clean workspace, no preference changed. Different code examples e.g. longer classes also are pasted very slowly. Almost whole time is spend on code: PhpFormatter.formatLine(IStructuredDocument document, int lineNumber) { .... insertionStrategy.placeMatchingBlanks(document, resultBuffer, lineNumber, document.getLineOffset(lineNumber)); .... } and 'insertionStrategy' is an instance of DefaultIndentationStrategy.
Patch proposition https://git.eclipse.org/r/#/c/29913/
Merged: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=c16afbf986341721816d0fcffd5efbea8c6a0090 Pasting is now much faster. Thank you Michal! It's still working too slow, so I keep this bug open.
optimization + refactoring - https://git.eclipse.org/r/#/c/30545/
Merged, http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=3d6def3803ad3aa4fdd3d622d088fef58ab86f64 Thank you! Issue is still open.
I am also having major performance issues with copying and pasting code of any length in PDT. Michal, what memory configuration have you given Eclipse? I find that Eclipse idles at ~ 100MB active heap, but the moment I touch copy or paste, it uses 1GB or more of transient heap (as observed in jvisualvm), and takes several seconds to respond. This is on an 8 core machine, so clearly unacceptable. Not sure if I should open a separate bug for that problem, or if it might be related to this one.
(version Luna 4.4.1. Currently with Eclipse max heap 2GB)
This issue is not closed because copy/paste is far from perfect, but related code is old and difficult to refactor. I was able to speed it up, but during my work I didn't notice so big memory consumption like in your case. Can you use attached example and check if this code will use also such amount of memory? Or maybe you can provide your code snippet? I think we can stay with this bug, no need to open another.
I have a possible culprit. Over the years, my DLTK h2 database had grown to this size: [toby@macpro .plugins]$ ls -l *.h2 total 7941496 -rw-r--r-- 1 toby staff 5947808 7 Jul 2013 model.285.log.db -rw-r--r-- 1 toby staff 2684354608 7 Jul 2013 model.data.db -rw-r--r-- 1 toby staff 1375731760 7 Jul 2013 model.index.db I removed it and re-launched Eclipse, which now means that Content Assist works again! I'm pretty sure this has fixed my copy/paste issue (huge memory spikes, and long pauses).
Ok, it looks that I was wrong:) Your issue was something difference than this issue. Problem described here is visible even with new and clean workspace. There are some cases where copy/paste takes more time because indentation algorithm is not optimal. Your problem is probably related to too big indexer database. Please create additional bug report with info you provided here. Thanks:)
(In reply to Toby Thain from comment #8) > I removed it and re-launched Eclipse, which now means that Content Assist > works again! > > I'm pretty sure this has fixed my copy/paste issue (huge memory spikes, and > long pauses). You probably was affected by bug #456902
Yes, I probably was affected by that bug. About the copy and paste issue - Seems I spoke too soon (it was late and I didn't test thoroughly). Looks like the slow copy and paste issue still exists, even after clearing DLTK. Also the memory spikes are still there.
Can you attach any code sample you were testing?
(In reply to Michal Niewrzal from comment #12) > Can you attach any code sample you were testing? I have this problem with any mixed HTML/JS/PHP file. Today the web/PDT performance problems are so severe (just maxed out 8 3GHz cores indefinitely again in a gc hang, heap set at 2gb) that I now have to move to IntelliJ. First time in more than 10 years using Eclipse.
If you have big (compiled/minimized) JS file in your JavaScript include path, JSDT will kill any eclipse installation :/