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 200087 - Extremely slow project scanning
Summary: Extremely slow project scanning
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal with 3 votes (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-07-12 15:56 UTC by mclaborn
Modified: 2012-06-06 13:19 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file with FINE logging - showing a slow scan (244.68 KB, application/x-gzip)
2011-08-17 14:32 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2011-07-12 15:56:17 UTC
Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Linux version 2.6.35-30-generic running on amd64
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.1-b02

I have a project "MMCommon" that is used by almost all of my other NB projects.  Whenever I do refactoring in classes within MMCommon, the project scanning that goes on takes a long, long, long time - sometimes 3 minutes or more.  During this time, the pop up help for methods, etc is not available when I need it the most. 

During the project scanning, I see this message repeatedly in the IDE log:

INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=com.csc.mm.MMTabbedPane$2 ]
WARNING [org.netbeans.modules.j2ee.metadata.model.api.support.annotation.PersistentObjectManager]: typesAdded: type ElementHandle[kind=CLASS; sigs=com.csc.mm.MMTabbedPane$2 ] has dissapeared

com.csc.mm.MMTabbedPane is a class in the MMCommon project.  I don't know what the messages mean or if they are causing or contributing to the slow scanning.
Comment 1 mclaborn 2011-08-16 19:13:23 UTC
This is really slowing me down.  Any progress?
Comment 2 Petr Jiricka 2011-08-17 08:33:14 UTC
Hi, can you please include a more detailed log of the scanning operations? See this HOWTO:
http://wiki.netbeans.org/FaqScanningAndIndexingIssues

Basically, run the IDE with the following parameter:
-J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE

Thanks. Also, did you try updating to 7.0.1 using the Tools -> Plugins dialog? That may fix some problems.
Comment 3 mclaborn 2011-08-17 14:30:14 UTC
I did update to 7.01.

Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02
System: Linux version 2.6.35-30-generic running on amd64; UTF-8; en_US (nb)
Userdir: /home/mclaborn/.netbeans/7.0

I edited a file in my most-used project, adding this method:
  public static String fred() {
    return "fred was here";
  }


The resulting scan took about 90 seconds, measured by watching the status bar at the bottom of the NB windows.  I will shortly attach the log file with FINE logging enabled.  I've marked in it where I think that this scan started with 
============Scan starts here==================
Comment 4 mclaborn 2011-08-17 14:32:19 UTC
Created attachment 110044 [details]
log file with FINE logging - showing a slow scan

log file with FINE logging - showing a slow scan.
Start position of scan is marked in log with
============Scan starts here==================
Comment 5 Petr Jiricka 2011-08-17 14:49:01 UTC
Assigning to Java -
Comment 6 mclaborn 2011-09-06 22:14:33 UTC
Any ideas on this?  I just had to refactor 4 methods, deprecating them in one project and moving to another project.  What should have been a 5 minute task took more like 20.
Comment 7 mclaborn 2011-09-23 22:00:10 UTC
Any progress??  I need to do a lot of refactoring and this is really slowing me down.
Comment 8 ceklock 2011-10-17 22:54:32 UTC
Related bugs: 

Slowness after "Clean and Build Main Project"
https://netbeans.org/bugzilla/show_bug.cgi?id=203351

Option to enable "Verbose Project Scan"
https://netbeans.org/bugzilla/show_bug.cgi?id=203859

JUnit calls 'Clean and Build' without need
https://netbeans.org/bugzilla/show_bug.cgi?id=203618
Comment 9 mclaborn 2011-10-27 13:52:45 UTC
This is still a big problem for me.  I can count on a 2 - 3 minute delay every time I edit a class in one of my common projects.
Comment 10 mclaborn 2011-11-17 17:07:18 UTC
Arrrgh!  This is really a problem. Any progress?
Comment 11 Tomas Zezula 2011-11-18 08:08:49 UTC
The slow rescan after save is mostly when you modify the file on which depend lots of other classes.
The NB by default updates the error badges on these dependent files in all open projects which depend on the project.
This can be customized in Tools/Options/Editor/Hints. In the Tree with hints select "Dependency Scanning" (should be the last one) and change scope.
Comment 12 mclaborn 2011-11-18 14:19:18 UTC
Changing the scope certainly helps, but disables a major piece of very useful NB functionality.  I will certainly change the scope next time I am doing some major refactoring.  I consider this a workaround rather than a solution.

The project scanning seems to take inordinately long.  Maybe something could be done to speed it up.

The real impact for me with the long project scans is that it disables the autocomplete/suggest feature while the scan is running. If the suggestion feature could be decoupled from the project scanning, most of my problem would go away. I can live with the error badges taking a while to be updated, as long as I can continue to code with autocomplete while the scan is running.
Comment 13 ceklock 2011-11-18 18:26:36 UTC
What happened with the "Scan on demand" feature?
Comment 14 ceklock 2011-11-18 18:31:10 UTC
(In reply to comment #0)

Try to use your common project as library. Create a jar containing all the classes and use the jar in the other projects.
Comment 15 Tomas Zezula 2012-06-06 13:19:19 UTC
Fixed jet-main 41985eb45913.
In the NB 7.2 the indexing does not block editor features as it's transactional.
In addition of it there were performance improvements in scanning.
For all changes see: http://wiki.netbeans.org/IndexingPerformance72