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 61410 - Hint invocation done in AWT thread, blocking it and w/o any progress indication
Summary: Hint invocation done in AWT thread, blocking it and w/o any progress indication
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2005-07-26 14:56 UTC by Antonin Nebuzelsky
Modified: 2005-09-05 10:01 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 Antonin Nebuzelsky 2005-07-26 14:56:08 UTC
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.
Comment 1 Pavel Flaska 2005-07-26 15:19:59 UTC
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.
Comment 2 Antonin Nebuzelsky 2005-07-26 15:33:37 UTC
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...
Comment 3 Pavel Flaska 2005-07-26 16:09:03 UTC
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.
Comment 4 Antonin Nebuzelsky 2005-07-28 09:26:51 UTC
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.
Comment 5 Pavel Flaska 2005-08-04 10:01:26 UTC
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
Comment 6 Antonin Nebuzelsky 2005-08-04 11:57:27 UTC
Looks better. Thanks.