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 226074 - Editor hints popup too slowly
Summary: Editor hints popup too slowly
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.2.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 15:42 UTC by greggwon
Modified: 2013-03-20 09:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace of activities while waiting for hints menu to popup. (23.70 KB, text/plain)
2013-02-13 15:42 UTC, greggwon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description greggwon 2013-02-13 15:42:08 UTC
Created attachment 131355 [details]
Stack trace of activities while waiting for hints menu to popup.

When editing large class files, editor hints, when clicking on the light bulb, seem to take a very long time to come up.  It seems that there could be a faster display of the hints, since the light bulb is already there, the hints are already known.  I've attached a stack trace from a pause in the hint popup.  I think that the hint selection menu should display immediately with the selections, and then based on the selection, any needed meta data can be discovered and the action taken.
Comment 1 Jan Lahoda 2013-02-21 18:38:03 UTC
(In reply to comment #0)
> Created attachment 131355 [details]
> Stack trace of activities while waiting for hints menu to popup.
> 
> When editing large class files, editor hints, when clicking on the light bulb,
> seem to take a very long time to come up.  It seems that there could be a
> faster display of the hints, since the light bulb is already there, the hints
> are already known.  I've attached a stack trace from a pause in the hint popup.

The hints are not necessarily known at that time - the bulb could remain there from the previous round of computation, and the results may be obsolete (from the stacktrace, it is clear the warnings (and conversely their fixes/"hints") were being computed), in which case these need to be updated.

In general, there are two basic ways to react on the request for the hints pop-up to show up:
1. show the popup with whatever result are available
2. ensure the popup contains up-to-date data (i.e. recompute the data that are obsolete)

For a few releases since 6.0 we used "1.", and switched to "2." around 6.5, to get more predictable behaviour. There is of course a cache to prevent recomputation of up-to-date warnings/hints. I'll check if that cache still works properly.

It would be good to have a profiler snapshot to see the times spent in various parts - the NFABasedBulkSearch normally runs fast, although I have seen a few snapshots lately where it was consuming much more time than it should, for reasons that are not completely clear to me (see bug #224954).

>  I think that the hint selection menu should display immediately with the
> selections, and then based on the selection, any needed meta data can be
> discovered and the action taken.
Comment 2 greggwon 2013-02-22 00:00:08 UTC
If I let the IDE sit for a moment, not doing anything, and then click on a badge, the hint pops up immediately.  If I then scroll down to another badge, that one pops up slowly.  So, I really think that the complete file is being reparsed.  The stack traces while the menu is not showing yet, indicate that a parse of the file (or some file) is in progress.  The fact that the EDT is waiting for that parse to finish, makes other things inaccessible in the IDE as well.  I think this is really one of those "100ms" issues.  It would be interesting to put the timer/wait checker into this logic to see how many people are actually experiencing a delay here.  I'm guessing that anyone with a large file is.  That might be an interesting metric to watch too.
Comment 3 Quality Engineering 2013-02-24 05:44:44 UTC
Integrated into 'main-golden', will be available in build *201302232300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/53f77d9eb039
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #226074: fixing the hints-are-up-to-date cache for error and introduce providers
Comment 4 greggwon 2013-02-25 01:06:36 UTC
Great, I'll try to run with this update in the next week or so to see if there is anything else going on.
Comment 5 Jiri Prox 2013-03-13 14:57:25 UTC
verified
Comment 6 Jan Lahoda 2013-03-14 09:49:56 UTC
release73:
http://hg.netbeans.org/releases/rev/f365b8eb3669

and adjusted spec./impl. versions of spi.java.hints:
http://hg.netbeans.org/releases/rev/3da6624d9334

There is some chance this will break update through AUC (a synchronous update of two modules bound by impl. version) - please anybody feel free to revert the changes (or let me know I should revert them) if problems occur.

Thanks.
Comment 7 Quality Engineering 2013-03-14 21:19:37 UTC
Integrated into 'releases', will be available in build *201303141828* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/f365b8eb3669
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #226074: fixing the hints-are-up-to-date cache for error and introduce providers