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.
Invocation of a hint can take a long time because it can effectively mean quite complicated refactoring action. Currently it is invoked in AWT thread, blocking it, leaving the UI gray and without any progress indication. Such a long action cannot be done in AWT thread. It must be done in a worker thread and a progress indication must be provided to the user.
i) Can you provide exact hint invocation which is slow? ii) Do you have any time consumption measured? iii) I do not know about any complicated refactoring action in hint invocation. Do you have any concrete example? iv) Do you have any suggestion how many steps should be in progress bar? This is too general description, I do not see any defect. Marking INCOMPLETE.
Invocations of hints on my fast notebook do not take always <=100ms, I saw noticeably longer times. Progress indication does not mean necessarily a progress bar, hour-glass cursor may be enough (if you know it takes in max up to a few seconds). BTW, there is already an attempt of showing it (see first few lines of code in HintsUI.invokeHint()) but this cannot work, of course, because you block AWT thread during the whole action...
Thanks for answering question iv). It would be also great if you can provide answers also to other questions. We want to find inefficient code rather than fallbacking to progress indication immediately. Thanks.
As we were discussing on yesterday's perf meeting, the cases when hint invocation takes longer are a bit random, maybe caused by GC comming at the moment. Anyway, what user sees in that case is a gray rectangle (after the hint popup disappears) which lets the user notice that painting is blocked until the action finishes. This is not nice. Even though the action does not take terribly long, painting should be done in a responsive way, thus AWT thread should not be blocked, and the hour-glass cursor should appear.
Checking in src/org/netbeans/modules/editor/hints/HintsUI.java; /cvs/editor/hints/src/org/netbeans/modules/editor/hints/HintsUI.java,v <-- HintsUI.java new revision: 1.13; previous revision: 1.12 done
Looks better. Thanks.