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 172464

Summary: [69cat] Invoking insert-break took 17927 ms.
Product: java Reporter: matusdekanek <matusdekanek>
Component: JavadocAssignee: Jan Becicka <jbecicka>
Status: RESOLVED FIXED    
Severity: blocker CC: FrantaM, gtg, ivan, janario, jmichelberger, locutus, majiknet, mase, misterm, mklaehn, mvfranz, mwaller, seppl, shunbul, stefan79, trian, tzezula
Priority: P3 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=158664
Issue Type: DEFECT Exception Reporter: 158664
Attachments: nps snapshot
nps snapshot
nps snapshot
nps snapshot
nps snapshot

Description matusdekanek 2009-09-17 12:06:34 UTC
This issue was originally marked as duplicate of issue 169864, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related.

Build: NetBeans IDE Dev (Build 200909140908)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Linux, 2.6.28-15-generic, i386

User Comments:
matusdekanek: inserting javadoc into source (writing /** and pressing enter)


Maximum slowness yet reported was 17927 ms, average is 17927
Comment 1 matusdekanek 2009-09-17 12:06:40 UTC
Created attachment 87844 [details]
nps snapshot
Comment 2 matusdekanek 2009-09-17 12:45:22 UTC
If I understand the snapshot correctly, after pressing enter, the IDE tries to compile the code (or at least runs a
'CompilationJob' instance), because of what it requests source roots of the project(s) and because it is a bigger
project (netbeans profiler), it requires project source root(s) more than 20 times and subsequently calls loadProject
more than 40 times. That invokes 'createProject' more than 140 times... I do not need to continue, that is 100-200 file
operations.

I think this really should not happen for just one 'enter' after the javadoc comment start, regardless of the size of
the project.
Comment 3 Jan Pokorsky 2009-09-17 14:08:45 UTC
Of course the action does not touch so many files. It looks like the scanning was still running when you pressed enter.
It waited for the scan is finished. The only solution would be not to generate javadoc skeleton then.
Comment 4 matusdekanek 2009-09-17 15:43:37 UTC
Ok, that might be explanation. 
Although the project was already scanned when it was open (before few hours..) and the scanning indicator in status bar
did not appear. The changes in project were only minor, so there should not be reason for such an extensive scan. 
Comment 5 Jan Pokorsky 2009-09-17 16:50:49 UTC
Tome, any idea why should the scan take so long (~20 s) in a already indexed project? In the snapshot I see that the
java indexer loads some NetBeans projects which takes most of time.

It could be triggered by e.g. updating sources outside the IDE and switching back.

In case you see editor hints or highlighted symbol occurrences in the editor there is no reason why it should take so
long. The file is already parsed and attributed.
Comment 6 Tomas Zezula 2009-09-24 13:51:20 UTC
Even the up to date check may take long time for api support projects, dependency set up is quite expensive.
GenerateJavadocAction should use Lahvacovo RunOffAWT or runWhenScanFinished (The RunOffAWT is probably much better for hint).
Comment 7 Jan Pokorsky 2009-10-01 13:34:46 UTC
tzezula:
But it is not an editor hint. The user is typing in editor. He types <enter>. We cannot insert anything in background
now. It could result in unwanted mess. Neither RunOffAWT nor runWhenScanFinished are suitable in this case IMO.

Why is it necessary to set up project dependencies or perform the up to date check again? As written above the IDE was
running with the open project for hours.

Some java.source API support which would allow to run over parsed file without waiting for scan would be helpful here.
It should be possible to rewrite the action to use Tree instead of Element.
Comment 8 Tomas Zezula 2009-10-01 13:40:28 UTC
>Why is it necessary to set up project dependencies or perform the up to date check again? As written above the IDE was
>running with the open project for hours.
Sometimes it's enough that metadata file is touched.

>Some java.source API support which would allow to run over parsed file without waiting for scan would be helpful here.
Yes, it's probably the way we should try. But probably not for 6.8.
Comment 9 Exceptions Reporter 2009-10-05 09:09:21 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3940-on-090917)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Windows XP, 5.1, x86

User Comments: 
the project was scanned again.
it feels like the 'project scanning' is always "in the way"
Maximum slowness yet reported was 21547 ms, average is 12270
Comment 10 Exceptions Reporter 2009-10-05 09:09:31 UTC
Created attachment 88813 [details]
nps snapshot
Comment 11 Exceptions Reporter 2009-10-05 09:09:39 UTC
This issue already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=158664
Comment 12 mklaehn 2009-10-05 18:23:17 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-4040-on-091003)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments: 

Maximum slowness yet reported was 21547 ms, average is 10746
Comment 13 mklaehn 2009-10-05 18:23:21 UTC
Created attachment 88861 [details]
nps snapshot
Comment 14 Exceptions Reporter 2009-10-05 18:23:26 UTC
This issue already has 6 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=158664
Comment 15 gtg 2009-10-07 09:19:25 UTC
Build: NetBeans IDE Dev (Build 200910061401)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Linux, 2.6.27.29-0.1-default, amd64

User Comments: 

Maximum slowness yet reported was 131406 ms, average is 27983
Comment 16 gtg 2009-10-07 09:19:30 UTC
Created attachment 88974 [details]
nps snapshot
Comment 17 Exceptions Reporter 2009-10-07 09:19:35 UTC
This issue already has 7 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=158664
Comment 18 Max Sauer 2009-10-21 14:44:51 UTC
*** Issue 164569 has been marked as a duplicate of this issue. ***
Comment 19 majiknet 2009-12-09 09:58:35 UTC
Created attachment 92348 [details]
nps snapshot

Editing java files whilst waiting for a query to a large DB table (MySQL) to cancel.
Comment 20 ivan 2010-06-08 21:16:19 UTC
My report, with id #399822, isn't mentioned in this bug.
But it dawned on me that when I insert a /** above a method,
everything below it potentially til the end of the file, is considered
as one giant comment. (No-one else has mentioned this in this bug
it seems).
The most time is spent in javadoc.hints.GenerateJavadocAction.
So presumably it doesn't scale well for very large comments?
Comment 21 ivan 2010-06-08 21:19:13 UTC
Hmm scratch the big-comment idea when I looked at my src it wasn't that big.
Comment 22 Jan Becicka 2010-10-15 11:42:54 UTC
Changeset: http://hg.netbeans.org/jet-main/rev/26d18848eb56
Author:    Jan Becicka <jbecicka@netbeans.org>
Date:      2010-10-15 13:37
Message:   Issue #172464 - [69cat] Invoking insert-break took 17927 ms.