Bug 325829 - Very slow code completion for larger completion lists
Summary: Very slow code completion for larger completion lists
Status: VERIFIED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2010-09-21 06:59 EDT by Bernd Kolb CLA
Modified: 2011-03-07 11:06 EST (History)
12 users (show)

See Also:


Attachments
Project to reproduce the problem (34.14 KB, application/x-zip-compressed)
2010-09-21 06:59 EDT, Bernd Kolb CLA
no flags Details
Configuration (395.59 KB, text/plain)
2010-09-21 09:18 EDT, Bernd Kolb CLA
no flags Details
dump (28.31 KB, text/plain)
2010-10-18 08:50 EDT, Bernd Kolb CLA
no flags Details
dump (27.99 KB, text/plain)
2010-10-18 08:53 EDT, Bernd Kolb CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Kolb CLA 2010-09-21 06:59:39 EDT
Created attachment 179297 [details]
Project to reproduce the problem

Steps to reproduce:
1) Install the Android Eclipse Tooling from http://developer.android.com/sdk/index.html (I am using Android API version 8)
2) import the attached Project
3) open com.example.android.skeletonapp.SkeletonActivity and go to line 57
4) insert . --> wait ~4 sec 
5) start typing set '-->' wait between 10 and 30 sec.

The next time it seems to be faster but it still takes up to 5 sec.

I think this issue is major or even critical as it makes Eclipse hardly usable in such scenarios.
Comment 1 Dani Megert CLA 2010-09-21 07:17:10 EDT
Bernd, please answer the following questions:
- which build id?
- on top what exactly did you install it?
- do you see the problem when installing on top of 3.6.1 from here:
http://download.eclipse.org/eclipse/downloads/drops/M20100909-0800/index.php
- does Android install its own content assist proposal kind(s) (Java > Editor > Content Assist > Advanced)? If so, does the problem go away if you restore the defaults?
Comment 2 Bernd Kolb CLA 2010-09-21 09:18:10 EDT
(In reply to comment #1)

Hi Dani,
> Bernd, please answer the following questions:
> - which build id?
Eclipse: 
 - Version: 3.6.0
 - Build id: I20100608-0911

> - on top what exactly did you install it?
Classic Eclipse Distro
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.6-201006080911/eclipse-SDK-3.6-win32-x86_64.zip

Later I installed WTP, EGit and the Android Tooling. I'll attach the configuration for you.

> - do you see the problem when installing on top of 3.6.1 from here:
> http://download.eclipse.org/eclipse/downloads/drops/M20100909-0800/index.php
I have not tried yet, but I'll do and let you know.

> - does Android install its own content assist proposal kind(s) (Java > Editor >
> Content Assist > Advanced)? If so, does the problem go away if you restore the
> defaults?
No, there are just the normal entries
Comment 3 Bernd Kolb CLA 2010-09-21 09:18:50 EDT
Created attachment 179311 [details]
Configuration
Comment 4 Bernd Kolb CLA 2010-09-21 14:44:08 EDT
I tried 3.6.1 now as well, same issue.
Comment 5 Ayushman Jain CLA 2010-09-22 05:59:04 EDT
I tried to reproduce using your project but couldn't. Please note that Android Development Tools is only supported for 3.5 or lower.
You can check that http://developer.android.com/sdk/eclipse-adt.html says "Caution: There are known issues with the ADT plugin running with Eclipse 3.6. Please stay on 3.5 until further notice". 

So can you please use 3.5 instead? It doesn't seem like an eclipse related issue since you're only facing this on completion of Android proposals.
Comment 6 John Smith CLA 2010-09-27 05:02:36 EDT
(In reply to comment #5)
> I tried to reproduce using your project but couldn't. Please note that Android
> Development Tools is only supported for 3.5 or lower.
> You can check that http://developer.android.com/sdk/eclipse-adt.html says
> "Caution: There are known issues with the ADT plugin running with Eclipse 3.6.
> Please stay on 3.5 until further notice". 
> 
> So can you please use 3.5 instead? It doesn't seem like an eclipse related
> issue since you're only facing this on completion of Android proposals.

I have just downloaded Helios 3.6.0 Java EE build.
Cleanly. First time. Few times on different computers.
The assist issue has been reproduced.
I had not such problem with 3.5.
It is definitely 3.6.0 issue.
Comment 7 Ayushman Jain CLA 2010-09-27 05:13:09 EDT
(In reply to comment #6)
>[..]
> I have just downloaded Helios 3.6.0 Java EE build.
> Cleanly. First time. Few times on different computers.
> The assist issue has been reproduced.
> I had not such problem with 3.5.
> It is definitely 3.6.0 issue.

Since you dont have the issue with 3.5, it only makes it more probable that its an issue with ADT and not eclipse. Can you please stick to 3.5 for android development?
Comment 8 John Smith CLA 2010-09-28 08:07:14 EDT
(In reply to comment #7)
> (In reply to comment #6)
> >[..]
> > I have just downloaded Helios 3.6.0 Java EE build.
> > Cleanly. First time. Few times on different computers.
> > The assist issue has been reproduced.
> > I had not such problem with 3.5.
> > It is definitely 3.6.0 issue.
> 
> Since you dont have the issue with 3.5, it only makes it more probable that its
> an issue with ADT and not eclipse. Can you please stick to 3.5 for android
> development?

I dont use any ADT. I just wrote it because I dont like when such ordinary thing like assist working so slow.
Comment 9 Ayushman Jain CLA 2010-09-28 08:10:50 EDT
(In reply to comment #8)
[..]
> I dont use any ADT. I just wrote it because I dont like when such ordinary
> thing like assist working so slow.

I think you said you installed Android Tooling. Didn't you mean that you installed Android Development Tools(ADT) plugin?
Comment 10 Remy Suen CLA 2010-09-28 08:42:09 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > I dont use any ADT. I just wrote it because I dont like when such ordinary
> > thing like assist working so slow.
> 
> I think you said you installed Android Tooling. Didn't you mean that you
> installed Android Development Tools(ADT) plugin?

That was Bernd, the original reporter. John doesn't seem to have implied he installed ADT from comment 6.

If the Java EE build is the installation in question, it may be related to bug 317979.
Comment 11 Bernd Kolb CLA 2010-09-28 09:08:51 EDT
Hi,

I just checked again with 3.5 and I have the same issue there as well.

Some days ago I talked to Jochen (CC) and he indicated that he can see the problem as well.

Bernd
Comment 12 Ayushman Jain CLA 2010-09-28 09:46:39 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > I dont use any ADT. I just wrote it because I dont like when such ordinary
> > > thing like assist working so slow.
> > 
> > I think you said you installed Android Tooling. Didn't you mean that you
> > installed Android Development Tools(ADT) plugin?
> 
> That was Bernd, the original reporter. John doesn't seem to have implied he
> installed ADT from comment 6.

Oops, i didn't notice.
Bernd, I'm still unable to reproduce with your project. Can you please attach a thread-dump so that we can investigate?
Comment 13 greenender CLA 2010-09-29 05:04:05 EDT
(In reply to comment #0)
> Created an attachment (id=179297) [details]
> Project to reproduce the problem
> 
> Steps to reproduce:
> [...]
> 
> I think this issue is major or even critical as it makes Eclipse hardly usable
> in such scenarios.

I have excatly the same problem, Eclipse 3.6.0 and Android Eclipse Tooling (version 0.97 and latest 0.99 - both the same problem). Makes Android/Eclipse development paniful ...
Comment 14 Ayushman Jain CLA 2010-09-29 05:28:31 EDT
(In reply to comment #13)
>[..]
> I have excatly the same problem, Eclipse 3.6.0 and Android Eclipse Tooling
> (version 0.97 and latest 0.99 - both the same problem). Makes Android/Eclipse
> development paniful ...

Do you also have this problem on Android proposals, or usual java proposals as well?
Side note: I want to reiterate that ADT is not compatible with Helios.
Comment 15 greenender CLA 2010-09-29 15:47:27 EDT
(In reply to comment #14)
> (In reply to comment #13)
> >[..]
> > I have excatly the same problem, Eclipse 3.6.0 and Android Eclipse Tooling
> > (version 0.97 and latest 0.99 - both the same problem). Makes Android/Eclipse
> > development paniful ...
> 
> Do you also have this problem on Android proposals, or usual java proposals as
> well?
> Side note: I want to reiterate that ADT is not compatible with Helios.

Looks, like this is a common problem, ADT with Helios:
http://www.listware.net/201007/android-developers/30746-android-developers-eclipse-helios-36-code-assist-very-slow.html
Comment 16 Bernd Kolb CLA 2010-09-29 16:28:48 EDT
After setting up a new workspace on 3.5 with ADT it is working again. So it seems to be indeed an 3.6 issue (which seems to remain if you use an 3.6 workspace in 3.5...).

What would you need in order to verify that it is an ADT and not a JDT issue?
Comment 17 Bernd Kolb CLA 2010-09-29 16:37:58 EDT
Cross-posting the respective issue in the ADT bug tracker:
http://code.google.com/p/android/issues/detail?id=10855
Comment 18 Ayushman Jain CLA 2010-09-30 01:28:16 EDT
Thanks a lot Bernd and Greenender for confirming that this issue is specific with Android and Helios. What amazes me is that despite the explicit specification on the Android website about incompatibility of ADT with Helios, people are still trying to use the latter! Why not just use 3.5 and code hassle-free ;)

Bernd, thanks for posting the issue on the android site. Can you provide a stackdump using instructions given on http://wiki.eclipse.org/How_to_report_a_deadlock. This should confirm whether the ADT plugin is coming into picture or not. Thanks
Comment 19 Bernd Kolb CLA 2010-10-01 04:19:11 EDT
(In reply to comment #18)
> Thanks a lot Bernd and Greenender for confirming that this issue is specific
> with Android and Helios. What amazes me is that despite the explicit
> specification on the Android website about incompatibility of ADT with Helios,
> people are still trying to use the latter! Why not just use 3.5 and code
> hassle-free ;)

Well :-) To be quite frank, I did not read this until you pointed me to this section. I guess it is a classical situation for RTFM (or replace manual with installation instructions in that case...) :-)

> 
> Bernd, thanks for posting the issue on the android site. Can you provide a
> stackdump using instructions given on
> http://wiki.eclipse.org/How_to_report_a_deadlock. This should confirm whether
> the ADT plugin is coming into picture or not. Thanks

I am currently on a trip. Once I am back, I'll attach it here.
Comment 20 Ayushman Jain CLA 2010-10-12 13:38:15 EDT
(In reply to comment #19)
> [..]
> I am currently on a trip. Once I am back, I'll attach it here.

Any news on this?
Comment 21 Bernd Kolb CLA 2010-10-13 06:54:02 EDT
I just tried to reproduce this but somehow it is gone for now. I'll now run visualJVM in parallel to Eclipse and as soon as I can reproduce the problem I'll attach the dump

Bernd
Comment 22 Ayushman Jain CLA 2010-10-18 07:43:18 EDT
(In reply to comment #21)
> I just tried to reproduce this but somehow it is gone for now. I'll now run
> visualJVM in parallel to Eclipse and as soon as I can reproduce the problem
> I'll attach the dump
> 
> Bernd

Did you see this again?
Comment 23 Bernd Kolb CLA 2010-10-18 08:49:45 EDT
Funny :-) I was just about to send an update...

I got informed this morning about this isses in the Android bug tracker:
http://code.google.com/p/android/issues/detail?id=7850&q=adt&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars#c7

The issue reports a frozen Eclipse due to a wrong source location in the classpath container. Actually for debugging reasons I manually installed the android sources around the same time I was switching from Eclipse 3.6 back to 3.5. Now after working again with 3.6 the issue did not occur anymore.

After renaming the expected source location again I can reproduce the problem again (See thread dump attached)

HTH
Bernd
Comment 24 Bernd Kolb CLA 2010-10-18 08:50:03 EDT
Created attachment 181089 [details]
dump
Comment 25 Bernd Kolb CLA 2010-10-18 08:53:37 EDT
Created attachment 181091 [details]
dump

the new dump was taken faster after hitting ctrl+space
Comment 26 Ayushman Jain CLA 2010-10-20 10:32:06 EDT
(In reply to comment #23)

Thanks a lot Bernd for confirming this. 
So seems like this issue has been fixed by the Android dev team and shouldn't be a problem.
Jay, can you please check if we can be more robust in such a case when the source location is incorrectly specified?
Comment 27 Dani Megert CLA 2010-11-04 12:39:50 EDT
There must be more to it: bug 329288 reports a similar issue but the user isn't using Android Tooling. It looks like in both cases the time is wasted while fetching the parameter names.
Comment 28 GiUmaTo Mising name CLA 2010-12-18 10:58:34 EST
As I replied in another similar Eclipse bug thread: 
I had this problem and I tried the workaround suggested at this page, comment #8: 

http://code.google.com/p/android/issues/detail?id=7850#c8

and it definitely worked for me. 
Before doing that I had all the mentioned problems, specifically when accessing code complete for Android View objects (complete freeze for ca. 15s, code completion window on top of *every* other window). To a lesser extent there were also problems when accessing Activity objects.

My dev enviroment: 

Windows 7 64bit

Eclipse IDE for Java Developers
Version: Helios Service Release 1
Build id: 20100917-0705

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Android Development Toolkit
Version: 8.0.1.v201012062107-82219

I typically run 
Android SDK Platform 2.2_r1
Revision 2
API 8
Comment 29 Kostya Vasilyev CLA 2011-01-14 16:36:09 EST
Eclipse 3.6 SR1 "basic" for Java, Windows 7/64, Android ADT 8.0.1

There is an issue separate from the "sources" described above.

Android now includes a JavaDoc package. If this is installed, code assist still freezes from time to time.

Typically, this happens when code assisting a reference of a View subclass.

Uninstalling the Android JavaDoc package resolves the issue, but JavaDoc in code assist is obviously lost.

Same Android JavaDoc package works without a single hiccup with Eclipse 3.5 SR2 (same computer).

See here for an explanation by someone more knowledgable in Eclipse than I am:

http://groups.google.com/group/android-developers/browse_thread/thread/125fbab9f4f717b1/

The JavaDoc Android package is installed by Android SDK Manager, it's called "Documentation for Android SDK, API9, revision 1". I can submit it here as an attachment if needed.
Comment 30 Kostya Vasilyev CLA 2011-01-15 04:54:39 EST
Update on this issue with Android tools installed:

Apparently this is a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288.

I just tested a patched org.eclipse.jdt.code from here:

http://groups.google.com/group/android-developers/msg/0f9d2a852e661cba

which is the fix for 329288 backported into 3.6.

The fix worked, content assist is fast again, and includes JavaDoc.

Is there any way to release this fix with 3.6 SR2?

Seems like a pretty important issue, not limited to Android development, and the fix is pretty simple.
Comment 31 Ayushman Jain CLA 2011-01-15 14:05:41 EST
(In reply to comment #30)
> Update on this issue with Android tools installed:
> 
> Apparently this is a duplicate of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288.

Yes, your'e right. We fixed this for 3.7, but didnt really backport to 3.6.x. Lets take this discussion into bug 329288.
Comment 32 Dani Megert CLA 2011-03-01 10:28:58 EST
> > Apparently this is a duplicate of
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288.
> 
> Yes, your'e right. We fixed this for 3.7, but didnt really backport to 3.6.x.
> Lets take this discussion into bug 329288.
Ayush, looks like this can be closed, right?
Comment 33 Ayushman Jain CLA 2011-03-01 12:13:48 EST
(In reply to comment #32)
> > > Apparently this is a duplicate of
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288.
> > 
> > Yes, your'e right. We fixed this for 3.7, but didnt really backport to 3.6.x.
> > Lets take this discussion into bug 329288.
> Ayush, looks like this can be closed, right?

Yes, according to comment 23, this was a bug in Android and not Eclipse. So closing as NOT_ECLIPSE
Comment 34 Kostya Vasilyev CLA 2011-03-01 12:29:36 EST
(In reply to comment #33)
> (In reply to comment #32)
> > > > Apparently this is a duplicate of
> > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288.
> > > 
> > > Yes, your'e right. We fixed this for 3.7, but didnt really backport to 3.6.x.
> > > Lets take this discussion into bug 329288.
> > Ayush, looks like this can be closed, right?
> 
> Yes, according to comment 23, this was a bug in Android and not Eclipse. So
> closing as NOT_ECLIPSE

Comment 23 is another issue entirely.

This one is, or rather was, an Eclipse bug, please refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288 - it was fixed and released with 3.6 SR2.
Comment 35 Ayushman Jain CLA 2011-03-01 12:58:33 EST
(In reply to comment #34)
> Comment 23 is another issue entirely.

Comment 23 is a follow up by the reporter of this bug and corresponds to the same issue reported in comment 0. Comment 28 and 29 talked about the other issue which is fixed in bug 329288.
 
> This one is, or rather was, an Eclipse bug, please refer to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=329288 - it was fixed and
> released with 3.6 SR2.

The issue in 329288 corresponds to a problem in fetching javadoc. There's no such problem in this case as reported in comment 0. Wrong source location in the classpath container of Android was the problem in this case, and this has been resolved by the Android dev team.
Comment 36 Olivier Thomann CLA 2011-03-07 11:06:38 EST
Verified for 3.7M6.