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 178981 - Scanning is extremely slow
Summary: Scanning is extremely slow
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-22 09:53 UTC by Egor Ushakov
Modified: 2010-01-24 08:41 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
profiler snapshot (59.79 KB, application/octet-stream)
2009-12-22 09:54 UTC, Egor Ushakov
Details
stacktrace (34.36 KB, text/plain)
2009-12-22 09:55 UTC, Egor Ushakov
Details
patch (994 bytes, patch)
2010-01-19 04:57 UTC, Dusan Balek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2009-12-22 09:53:37 UTC
6.8 final, windows vista, I did some code modifications outside the IDE.
After that "scanning code..." is still happening, GUI is extremely slow, almost unusable. One core of my machine is 100% in use. Attaching stack trace and profiler snapshot.
Comment 1 Egor Ushakov 2009-12-22 09:54:38 UTC
Created attachment 92865 [details]
profiler snapshot
Comment 2 Egor Ushakov 2009-12-22 09:55:52 UTC
Created attachment 92866 [details]
stacktrace
Comment 3 David Strupl 2010-01-04 02:48:12 UTC
If I read the profiler snapshot correctly the problem is in the logging to stdout/stderr  by javac. A lot of the time is spent in flushing the output stream ... Please evaluate the TopLogging.LgStream.flush(). Thanks.
Comment 4 Jaroslav Tulach 2010-01-18 08:05:23 UTC
The question to ask is why there is so much logging from the compiler? Does it really print so much messages (and why), or does it just call flush without printing any messages?

Simplest fix would be to provide no-op flush log impl. Dušan, can that be done?
Comment 5 Dusan Balek 2010-01-19 04:56:23 UTC
If a DiagnosticListener is provided (which is the case of the java indexer), javac does not print any messages to stderr. So flush() is called without any logging from the compiler. Of course, providing no-op log impl is possible (see the attached patch), however, it only postpones the problem until some other code calls flush() on stderr IMHO.
Comment 6 Dusan Balek 2010-01-19 04:57:35 UTC
Created attachment 93406 [details]
patch
Comment 7 Jaroslav Tulach 2010-01-19 06:45:00 UTC
I've reported the slow flush as bug 179667 and I'll make it faster. Still, please apply your fix to JavaC. No flushing is always going to be faster than any optimized flush() implementation.
Comment 8 Dusan Balek 2010-01-19 08:36:31 UTC
Patch applied

http://hg.netbeans.org/jet-main/rev/c9c18b1d5226
Comment 9 Quality Engineering 2010-01-24 08:41:33 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c9c18b1d5226
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #178981: Scanning is extremely slow - fixed.