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.
The Schlieman's AnnotationManager acts as an ASTEvaluator in which afterEvaluation() method a task is posted into AWT thread. In the task, all existing annotations (added by this AM) are first removed and then created again. This is very time consuming since each of the annotation removal/add causes the area to be repainted. IMHO it is desired just to compare the current and new set of annotations and remove/add the diff.
That's true.
Marek, can you try to add some more info? I am not sure about your investigation. First, there are typically low number of annotations in one file. Performance of current solution looks good even if I create file with several hundreds of annotations (400 annotations ~200milliseconds). So, do you have some example - file with more annotations? And do you know how much time is really spend in AnnotationManager for your example? Second, are you sure that "each of the annotation removal/add causes the area to be repainted". I think that since I am blocking AWT thread all repaints should be collected.
Anyway, fixed on my side. You are right Marek, that adding several thousands of annotations to editor is very slow (2000 annotations ~ 8seconds). But I am still not sure if its real example. But, I will file an issue for editor. IDE:------------------------------------------------- IDE: [8/31/07 3:52 PM] Committing "AnnotationManager.java" started Checking in AnnotationManager.java; /cvs/languages/engine/src/org/netbeans/modules/languages/features/AnnotationManager.java,v <-- AnnotationManager.java new revision: 1.10; previous revision: 1.9 done IDE: [8/31/07 3:52 PM] Committing "AnnotationManager.java" finished