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.
This is what Mila found when he was debugging editor: Reparsing upon Alt+Right/Left Having several files openend in the IDE I was wondering why repetitive Alt+Right/Left "hangs" for a while especially for large files such as JTable or JComponent. I was suspect that there is some parsing in the background going on and surprisingly there really is. It's in JavaEditor.JavaEditorComponent.componentActivated() Although there is some additional condition for initiating of the parsing reqeust, in my setup it was parsing after each Alt+Right/Left even when there were no apparent annotations present in the file. When I removed the call to parseSource() the Alt+Right/Left switching was noticeably smoother. I can understand why the reparsing is being requested there - e.g. if I reference a non-existent method of some class C in my source then the parser will create an error annotation in my source. If I switch to class C and add that non-existent method and then return back to my original source I wish the error annotation to be removed even if I do not do any additional typing. Still I think the parsing is relatively expensive task to be done when changing the focus only so IMHO there should be at least some more sophisticated logic for initiating of the reparse (e.g. starting reparse once the user spends at least second or two in the given source). -Mila
Changing to P2. P-team decided to keep track of all significant performance regressions as P2s.
I'll investigate it.
Here is what I have found out: 1. The issue relates to overriden annotations. 2. JavaEditor.JavaEditorComponent.componentActivated() - true, it can invoke the parsing several times in case of large sources and switching between editors. This can slowdown ide but not to block it because the parser runs in background thread. I can solve this easily with improved check in componentActivated() that will count on just the 'hasAnnotation' property. 3. code handling overriden annotations is not properly synchronized so some inconsistences may occur. Since issues filed against this code become frequent I have decided to rewrite it.
Thanks. Ad threading: it is OK that runs in background but we know that even if the process has low priority in Java it can occupy the processor for a long time and cause bad perception. So if you can reduce the amount of work it will be an improvement.
Done. 1. Further editor component activations do not trigger parsing any more. 2. Introduced threading model. 3. I tried to minimize recreating of class elements by keeping them via hard references. The editor releases all references on its close. 4. plus some minor fixes. Despite all these changes computing of overriden annotations for newly open files remains pretty expensive. It needs to create class elements of all superclasses and interfaces which means to run the parser on a lot of files. I am afraid that without some lightweight parser there is not much place for futher improvements. /cvs/java/src/org/netbeans/modules/java/JavaEditor.java,v1.151 /cvs/java/src/org/netbeans/modules/java/OverrideAnnotation.java,v1.3 /cvs/java/src/org/netbeans/modules/java/OverrideAnnotationSupport.java,v1.1
Could someone from performance team verified this issue?