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 229674 - org.netbeans.modules.editor.hints.HintsUI.showPopup: LowPerformance took 35897 ms.
Summary: org.netbeans.modules.editor.hints.HintsUI.showPopup: LowPerformance took 3589...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2013-05-13 18:26 UTC by pwade
Modified: 2013-07-12 08:16 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 200611


Attachments
nps snapshot (56.73 KB, application/nps)
2013-05-13 18:26 UTC, pwade
Details
nps snapshot (54.24 KB, application/nps)
2013-05-29 16:28 UTC, dynamite
Details
Test to gather data (631 bytes, text/x-java)
2013-05-30 09:21 UTC, Jan Lahoda
Details
nps snapshot (51.28 KB, application/nps)
2013-06-04 15:22 UTC, Exceptions Reporter
Details
Patched module Editor Hints (307.61 KB, application/octet-stream)
2013-07-04 13:22 UTC, Roman Svitanic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pwade 2013-05-13 18:26:08 UTC
This bug was originally marked as duplicate of bug 229200, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201305102300)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7

User Comments:
pwade: Trying to get hint tip to pop-up.



Maximum slowness yet reported was 35897 ms, average is 35897
Comment 1 pwade 2013-05-13 18:26:10 UTC
Created attachment 134388 [details]
nps snapshot
Comment 2 dynamite 2013-05-29 16:28:20 UTC
Created attachment 135087 [details]
nps snapshot

I removed a throws Exception from a method, corresponding errors showed immeidately but I then waited ages for the editor to come back to life.
Comment 3 Jan Lahoda 2013-05-30 09:21:27 UTC
Created attachment 135114 [details]
Test to gather data

If someone who can reproduce on a build with #229200 could try to run this simple application and add its output to this bug, that would be very welcome. Thanks.
Comment 4 Exceptions Reporter 2013-06-04 15:22:29 UTC
Created attachment 135337 [details]
nps snapshot

I tried to get details about warning.
Comment 5 markiewb 2013-07-03 20:13:31 UTC
The very first opening of the hints popup blocks my NB74Dev from 20130626 WinXP32bit for seconds. I am running a multi monitor solution.

@Jan: Have you already tried to get the screenbounds using

//http://grepcode.com/file_/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/12.0/com/intellij/ui/ScreenUtil.java/?v=source
 public static Rectangle getScreenBounds() {
    Rectangle screenBounds = new Rectangle();
    final GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    final GraphicsDevice[] devices = env.getScreenDevices();
    for (final GraphicsDevice device : devices) {
      screenBounds = screenBounds.union(device.getDefaultConfiguration().getBounds());
    }
    return screenBounds;
  }

instead of

//http://hg.netbeans.org/main-golden/raw-file/tip/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsUI.java
    private Rectangle getScreenBounds() throws HeadlessException {
      Rectangle virtualBounds = new Rectangle();
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice[] gs = ge.getScreenDevices();

      if (gs.length == 0 || gs.length == 1) {
          return new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
      }

      for (int j = 0; j < gs.length; j++) {
          GraphicsDevice gd = gs[j];
          GraphicsConfiguration[] gc = gd.getConfigurations();
          for (int i=0; i < gc.length; i++) {
              virtualBounds = virtualBounds.union(gc[i].getBounds());
          }
      }

      return virtualBounds;
    }

? 
The first snippet is taken from Idea 11.0 (Apache 2.0 license) and the second one is from NetBeans 7.4dev
Comment 6 Roman Svitanic 2013-07-04 13:22:24 UTC
Created attachment 136717 [details]
Patched module Editor Hints

Could please someone who is able to reproduce this bug try and verify behavior with attached patched module?
(I am not able to reproduce original bug on my Win7 x64 machine, so I can't compare)

1. Download latest NetBeans dev build from http://bits.netbeans.org/download/trunk/nightly/latest/ (or if you have one downloaded you can use it as well)
2. Replace org-netbeans-spi-editor-hints.jar in {NetBeans_dir}\ide\modules with one attached to this post.
3. Start NetBeans and try to reproduce bug.
4. Please write result in comment (bug was solved/bug is still present + stacktrace if possible)

Thanks in advance for your cooperation.
Comment 7 markiewb 2013-07-04 13:53:44 UTC
(In reply to comment #6)
> Created attachment 136717 [details]
> Patched module Editor Hints
> 
> Could please someone who is able to reproduce this bug try and verify behavior
> with attached patched module?
> (I am not able to reproduce original bug on my Win7 x64 machine, so I can't
> compare)
> 
> 1. Download latest NetBeans dev build from
> http://bits.netbeans.org/download/trunk/nightly/latest/ (or if you have one
> downloaded you can use it as well)
> 2. Replace org-netbeans-spi-editor-hints.jar in {NetBeans_dir}\ide\modules with
> one attached to this post.
> 3. Start NetBeans and try to reproduce bug.
> 4. Please write result in comment (bug was solved/bug is still present +
> stacktrace if possible)
> 
> Thanks in advance for your cooperation.

I will try it on monday, when I am back to office.
Comment 8 markiewb 2013-07-08 09:27:02 UTC
(In reply to comment #7)
> > 1. Download latest NetBeans dev build from
> > http://bits.netbeans.org/download/trunk/nightly/latest/ (or if you have one
> > downloaded you can use it as well)
> > 2. Replace org-netbeans-spi-editor-hints.jar in {NetBeans_dir}\ide\modules with
> > one attached to this post.
> > 3. Start NetBeans and try to reproduce bug.
> > 4. Please write result in comment (bug was solved/bug is still present +
> > stacktrace if possible)
> > 
> > Thanks in advance for your cooperation.

Your patch worked for me. There is no initial pause anymore, when accessing the hint popup the first time. Looks good.

----
Product Version: NetBeans IDE Dev (Build 201307072319)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)
Comment 9 Roman Svitanic 2013-07-09 08:51:15 UTC
fixed in jet-main:
http://hg.netbeans.org/jet-main/rev/e6da40cf7503

Thanks markiewb for cooperation!
Comment 10 Quality Engineering 2013-07-12 02:29:39 UTC
Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e6da40cf7503
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #229674 - org.netbeans.modules.editor.hints.HintsUI.showPopup: LowPerformance took 35897 ms.
Comment 11 markiewb 2013-07-12 08:16:24 UTC
Verified in 201307112300