| Summary: | Content assist very slow on newer versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Simon Heider <simon.heider> | ||||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||||
| Status: | CLOSED WORKSFORME | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | jkubitz-eclipse, Lars.Vogel | ||||||
| Version: | 4.22 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 10 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Steps to reproduce: 1. Window > Preferences > Java > Editor > Content assist > Auto activation triggers for Java > type in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz." 2. Open some random source file and try to declare a new list: List<String> strings = new ArrayList<>(); Content assist box will load very slow. I could not reproduce that issue. Can you please add a sampling snapshot with VisualVM? A VisualVM sampler snapshot is in the attached .zip file. When I reset my content assist settings to default and redo step one from "steps to reproduce" the problem also occurs. Maybe you could reset your preferences too. I just found a little workaround: When I set "Auto activation delay (ms)" to 300 and start typing the first couple of letters and then stop typing, then the content assist loads fairly well. It's not the same experience as before, but if you can't track down the problem I could live with that. (In reply to Simon Heider from comment #3) > A VisualVM sampler snapshot is in the attached .zip file. Based on the given samplings it looks like it depends on the other yet uncompiled code/referenced Jars in your workspace. 0. Make sure Project/Build automatically is set. 1. Try Project/ Clean.. /Clean all pojects If that does not help: 2. May be it helps if you create a new workspace and reimport your projects If that does not help: 3. Try with a new empty workspace and create a new tiny java project from scratch. Still happens? If problem depends on your projects, please attached an example project where the problem occurs. The samples says the main (swt) thread spends most time in java.util.zip.ZipFile.<init>(). But i dont see static initializer there. Which JDK are you using? - Build automatically is always activated - I already did multiple clean builds We use Version 8 and 16 from OpenJDK. The problem seems to be Spring Boot. When I create a plain Java project, it seems to work fine (even with my existing workspace). When I switch to a Spring Boot project (attached) the problem occures again. The project is a new Spring Boot project, created with "Spring Initilizr" With Java 8, when typing "new ArrayList" Eclipse completly crashes. With Java 16 it takes 7-10 seconds. Steps to reproduce: 1. Import demo project into your workspace 2. Right click project > Configure > Add Gradle nature 3. Right click project > Gradle > Refresh Gradle Project Created attachment 287684 [details]
Spring Boot project
(In reply to Simon Heider from comment #6) > Steps to reproduce: > 1. Import demo project into your workspace > 2. Right click project > Configure > Add Gradle nature > 3. Right click project > Gradle > Refresh Gradle Project i could not reproduce that. 1. there was no .project which i could import as java project. 2. i know gradle creates the .project => So i imported the given demo with "Gradle/Existing Gradle Project" 3. after typing "new A" in com.example.demo.DemoApplication.main the content assists hung for several seconds, but after that initial hung all further assists are instant for me. I used a Java 11. Note that java 8 is not enough for eclipse anymore. eclipse requires minimum Java 11 now. Yes, the first time you try to construct a type takes the longest. After that it seems to be "indexed". But if you have a lot of types, you often have to construct types the first times. Anyway, thank you for your effords. It seems that I am the only one with this problem. I will just use my workaround, which works well enough. |
Created attachment 287673 [details] sampler dump and screenshots Hello, since I updated my Eclipse installation from 2019-06 to 2020-09 my content assist is very slow. 2020-12 didn't make it any better. I trigger content assist on every keystroke. When I disable this and only trigger it with CTRL+Space, the content assist completes in a reasonable time (otherwise it takes like 10 seconds and sometimes crashes completly). Content assist preferences are already set to the bare minimum (only Java Proposals are enabled). With 2019-06 I could trigger content assist with every keystroke and it completed in under a second. The project size does not seem to matter. Our main project has more than one million LOC. The behavior is the same for small modules with like 1k LOC. Some other bugtickets mention to check, if the sources are attached to the installed JRE. I already did that. I also increased the memory size of Eclipse to 4GB, which had no effect. A VisualVM samplerdump and some screenshots are attached. I hope this helps. It would be awesome, if we could find a solution for this problem, as i heavily rely on this feature. Best, Simon