This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 119004 - [60cat] Favorites Window UI responsiveness breaking UI guidelines and AWT thread blocked by Node opening
Summary: [60cat] Favorites Window UI responsiveness breaking UI guidelines and AWT th...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-10-16 07:49 UTC by _ theanuradha
Modified: 2007-10-19 10:53 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (19.18 KB, text/plain)
2007-10-18 08:54 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ theanuradha 2007-10-16 07:49:41 UTC
[ JDK VERSION : 1.6.0_02 ]

Favorites Window  UI responsiveness breaking UI guidelines and AWT
thread blocked by Node opening (At first time when IDE open)

Steps :

1: add some large folder structure like Netbeans src  folder 
2:try to open it will take 1 min and 30s (first time )
Comment 1 _ theanuradha 2007-10-16 07:54:41 UTC
Product Version: NetBeans IDE Dev (Build 071016)
Java: 1.6.0_05-ea; Java HotSpot(TM) Client VM 1.6.0_05-ea-b04
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

And T2300 at 1.66Ghz
and 2GB ram
Comment 2 _ theanuradha 2007-10-16 08:19:14 UTC
More Details :
First Time (after OS boot) It take 1Min and 30s
After close Ide and open it again only take 8s
But again restart OS and try to open node take 1Min and 30s

(Anyway computing children should be off from AWT Thread )
Comment 3 mslama 2007-10-17 19:20:42 UTC
I will profile IDE. Yes it can take long time because underlying code can do a lot of work (loaders detect file type for
every file/folder, in case expanded folder contains NB projects it is even worse). I do not know if it is possible to
perform node expansion asynchronously ie. avoid blocking AWT. I will investigate.
Comment 4 mslama 2007-10-18 08:53:34 UTC
apisupport blocks AWT thread in special case when expanded folder contains nb projects. Thread dump attached.
Comment 5 mslama 2007-10-18 08:54:26 UTC
Created attachment 51191 [details]
Thread dump
Comment 6 mslama 2007-10-18 10:03:14 UTC
I have profiler snapshot but it has ~2MB - too big to attach it here. If anyone is interested I can provide it.
Comment 7 Jesse Glick 2007-10-18 17:03:43 UTC
Roughly similar to issue #114155. In general: yes performance of apisupport on nb.org sources is slow, just wait for it,
it is not considered a priority to address.

*** This issue has been marked as a duplicate of 114155 ***
Comment 8 Petr Nejedly 2007-10-18 17:53:47 UTC
Well, I can't agree. This is completly different story, the AWT thread is blocked for a minute or so, that would be
considered a deadlock and a reason to kill the IDE by most users. FYI: I have run into this problem several times myself.
Maybe the error annotator should be more careful?
Comment 9 Petr Nejedly 2007-10-18 17:55:02 UTC
There's no component for tasklist so reassigning to java/source for evaluation.
Comment 10 Jesse Glick 2007-10-18 18:16:28 UTC
In this case the request for the classpath _is_ being done on another thread; EQ is blocking on Sources.getSourceGroups.
(Not clear if that could be moved to the other thread also?) Now apisupport's Evaluator already has an optimization that
it will not wait for the full ModuleList to be loaded in case you just ask for a property which does not need that.
However another thread is asking for the classpath, which does need ModuleList and is thus loading it, and access to the
delegating evaluator is synchronized for thread safety. I could probably tweak the synchronization strategy to avoid
this, but I have no idea if this is reproducible.
Comment 11 Jesse Glick 2007-10-18 18:27:49 UTC
Anyone who has observed this, see if the following helps:

Checking in Evaluator.java;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/Evaluator.java,v  <-- 
Evaluator.java
new revision: 1.29; previous revision: 1.28
done
Comment 12 Jan Lahoda 2007-10-18 20:08:28 UTC
Checking in ErrorAnnotator.java;
/cvs/java/source/src/org/netbeans/modules/java/source/tasklist/ErrorAnnotator.java,v  <--  ErrorAnnotator.java
new revision: 1.7; previous revision: 1.6
done
Comment 13 Petr Nejedly 2007-10-19 08:34:58 UTC
FYI: The easiest way to reproduce this (although not a typical use case) was to start the IDE with no NB projects opened
and navigate the Favorites explorer to the folder with NetBeans sources.
I'll try to verify this later.
Comment 14 _ theanuradha 2007-10-19 08:37:25 UTC
Verified
Comment 15 Petr Nejedly 2007-10-19 10:53:45 UTC
I can verify that the AWT blockage is gone. But when I tried it, I realized that the  scanPossibleProject() was called
twice for each subfolder (I had a timestamping println added to ModuleList)!

I started the IDE with new userdir, opened favorites, navigated to nball (which expanded quite quickly and then started
the scan in the background) and after a while I also expanded one of the subfolders.
Once the first scan finished ("findOrCreateModuleListFromNetBeansOrgSources took 61960ms" in my log file), another round
of project folder scan followed, this time not originating from findOrCreateModuleListFromNetBeansOrgSources.
I can attach my log file.