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 114238 - AnnotationManager implementation is very unefficient
Summary: AnnotationManager implementation is very unefficient
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 110302 114234
  Show dependency tree
 
Reported: 2007-08-30 12:27 UTC by Marek Fukala
Modified: 2007-08-31 14:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2007-08-30 12:27:05 UTC
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.
Comment 1 Jan Jancura 2007-08-30 17:37:02 UTC
That's true.
Comment 2 Jan Jancura 2007-08-31 13:39:55 UTC
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.

Comment 3 Jan Jancura 2007-08-31 14:57:53 UTC
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