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 106411 - Java source editing becomes very painful
Summary: Java source editing becomes very painful
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-06-12 18:06 UTC by mjreged
Modified: 2008-01-29 18:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of one of my persistance classes (279.67 KB, image/jpeg)
2007-06-15 00:11 UTC, mjreged
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mjreged 2007-06-12 18:06:51 UTC
I am building my intellectual property for a Construction Company.
I have about 7 projects that i imported to Nebeans 6 development edition. Over 100,000 lines of code, including long
persistence classes. Netbeans 6 editor has very usefull highlighting, readability and informational capabilities.
However the responsiveness of the cursor and real time source parsing suffers greatly while editing files, sometimes to
the point where my work flow gets seriously disrupted. Netbeans 5.5 had the ability to control parsing delay, i could
not find this feature in Netbeans 6 on JDK 6. I would usually delay the source parsing to be little longer so that i can
make some more significant changes before errors are highlighted. I don't see a point where i need to be shown errors
where i did not even finish typing that single line, specially when i get a huge performance degradation. 
I hope that this issue is being considered seriously, in real world of development i think this would be unacceptable.
Comment 1 Jan Lahoda 2007-06-12 18:16:36 UTC
What build do you use? There were significant performance improvements after M9.

Setting of longer reparse delay should not be necessary, as we are trying to interrupt parsing when the user starts
typing/moving caret in the editor.
Comment 2 mjreged 2007-06-12 18:54:31 UTC
I use daily builds.
Currently i am working on is 200706041800 the latest usually.
the concept of interrupting parsing sounds like a very good idea, however i believe it does not provide the desired
effect yet.  Well hopefully it will work up to par with Netbeans 5.5, i switched yesterday back to 5.5.1 and what a
difference, my productivity is so much faster.

I run on JDK 6 Only since i compile the code for 1.6
I run Linux Ubuntu 7.04
AMD Athlon 2400+
1GIG Ram
NVIDIA card.
Comment 3 Petr Hrebejk 2007-06-13 07:58:20 UTC
This issue will be considered seriously only if you provide more info. General statements are obviously not very
helpful. Not providing the info will likely result in resolution as invalid.

Please tell us:
1) What are the exact problems. Slow typing, slow code completion etc.
2) Try to realistically estimate the times
3) What do you mean by long classes. For example 100000 is relatively small project. Is a class a long class 1000 lines
or 5000 lines or 10000 lines. Btw. we test on 10000 lines code referring to 10000 different classes and we still get
decent performance.
4) What does the class contain? Lot of annotations. Lot of fields. Lot of methods , innerclasses ... if possible attach
such class (if ot fine)
5) How many jars are on your classpath.
6) Attach a screenshot of "runtime watches" The button next to the memory meter in the toolbar (looks like tacho) will
open a window which file objects (select the current one) and underneath the times needed to parse, attribute, etc the file
7) What is the memory consumption at the time you experience the problem? Does invoking GC (clicking on the memory meter
help to reduce the memory usage? If not you may be competing with GC for the processor.
8) add following option when running netbeans -J-Dorg.netbeans.api.java.source.JavaSource.reportSlowTasks=true and send
us the output when there are some warnings.
9) Try to experiment a bit go to tools->options->javacode. In the Hints tab switch off all the hints. In the tasklist
tab switch of the tasklist and watch the performance.

Comment 4 Tomas Zezula 2007-06-13 07:58:30 UTC
I am using NB 6.0 on much bigger code base (netbeans) without the "hangs". There may be several things causing the hangs. 
1) It may be old languages modules in your userdir, can you try to run the IDE on the fresh user dir with no settings
import to verify it? If it helps it is caused by this.
2) There are several slow non java core modules like task list and several hints (Javadoc hints). Can you try to turn
them off if it helps? The tasklist can be switched off by unchecking the check box in the Tools/Options/Java
Code/TaskList/Enable Javatasks. I also have problem with Javadoc hint which is in my opinion very very slow, can you
also try to switch it off in Tools/Options/Java Code/Hints/Javadoc?
Unfortunately I am not able to reproduce the behavior you describe so I need your help, thanks
Tomas
Comment 5 _ rkubacki 2007-06-13 09:04:24 UTC
It is possible that Java Persistence API support is important here. Adding Andrei to cc:
Comment 6 Andrei Badea 2007-06-13 17:41:09 UTC
That's of course possible. Could you try to disable the JPA Verification module? Open Tools - Plugins, go to the
Settings tab, check "Show details of all plugins", go the the Installed tab and uncheck the JPA Verification module.
Then restart NetBeans just to be sure and check if you still get the hangs.
Comment 7 mjreged 2007-06-15 00:11:10 UTC
Created attachment 43755 [details]
Screenshot of one of my persistance classes
Comment 8 mjreged 2007-06-15 00:32:30 UTC
Thank you guys for being so responsive, that speaks volumes.
So i did what was recommended, created new user on my linux box and turned off some of the hints features.
I am happy to say that the smoothness of typing inside my persistence class did improve to a better degree.
You see the slowness of the caret is not specific to a single situation where i can take a snapshot.
It's just stutters when i type and move about the sources. Like if i type a line p.getItsProject().removeProposal(p);
a lot of times as i type the caret fezzes at about "p.getItsProject("   and i don't see the characters come up until i
stop and let the editor catch up. So i actually keep on typing to the end of the line and if i missed a bracket i will
correct it once the line updates.
But since your recommendations it did get much better.

I also have to acknowledge that my computer at the moment is nowhere near top notch, so maybe i am expecting too much.
I also believe that the editor responsiveness is slower because of LINUX JDK implementation.
For example if i start up the IDE with GTK native Skin, then the IDE performance goes right out the window even though i
have fully accelerated X.
Run NETBEANS under compiz/Beryl, forget it even scrolling becomes unbearable. So I believe there is some truth to the
fact that JDK and then understandably Netbeans is underperforimng on Linux comparing to windows. And if that's the case
i guess there is nothing that the netbeans team can really address here.



Comment 9 kirillkh 2007-06-17 17:10:49 UTC
I have recently participated in a similar performance attack with considerable success. You might want to look at the
issue #96610 to get an idea of what data can be useful to the developers and how to gather it.
Comment 10 Tomas Zezula 2007-06-18 10:18:48 UTC
I am glad that new user dir helped, it seems that there was a languages module. On the slower computer turning off the
task list and javadoc hints helps. The problem with the javadoc hint is that it needs to parse not only the opened
source but also all the super classes of all classes in the source file up to java.lang.Object. When you open JTable it
can be more than 30 files, this is a reason why this hint is turned off by default in other IDEs, I've already propose
to turn it off too.
The freeze of the cursor is caused by some task (hint, overriden annotation, coloring) which ignores cancel. I will do
testing and fill an issue on it. On Friday I've fixed the case when task was canceled inside usages query, now the task
should be canceled even inside it.
Next thing which may improve the performance is a partial reparse which I've described in issue #96610, only the method
you type in will be reparsed.
Comment 11 Tomas Zezula 2008-01-29 18:14:43 UTC
I've integrated reparse of method which improves performance on the large files.
Commits:
173264ecf6ca
a32c31c1d811