[platform-dev] Re: Re: Performance issue with OutlineView

  • From: Frédéric Deniger < >
  • To:
  • Subject: [platform-dev] Re: Re: Performance issue with OutlineView
  • Date: Fri, 23 Nov 2012 11:22:40 +0100

With more digg, it seems that painting the button "..." takes a long time (org.openide.explorer.propertysheet.ButtonPanel.ConditionallyFocusableButton.paint(java.awt.Graphics).

If you modify your code by disabling the custom editor, you'll see an performance improvement:

private Property<String> _createProperty(String pKey, final String pValue) {
final ReadOnly<String> readOnly = new PropertySupport.ReadOnly<String>(pKey, String.class, name, "") {
        @Override
public String getValue() throws IllegalAccessException, InvocationTargetException {

          return pValue;
        }
      };
//remove the custom editor
      readOnly.setValue("suppressCustomEditor", Boolean.TRUE);
      return readOnly;
    }

A test could be to create a simple JTable using cell renderers with buttons and check that there isn't any perf problem with the Nimbus look and feel...

Fred

Le 23/11/2012 10:37, Johannes Boesl a écrit :
Thank you Frédéric. That are some interesting observations you made there.
I didn't mention I'm running my tests with java7 so it shouldn't be the paint routine here, right?
Did you remove the first line from the test to run without the netbeans propertyEditors? There's a big difference, too.

Thanks,
JBoesl



Am 23.11.2012 10:14, schrieb Frédéric Deniger:
Finally, I can't say if the performance problem is due to PropertyPanel.paint or SynthTableUI.update or another points...
The outlineView is more responsive without the NimbusLookAndFeel...

I found that the behavior is different between jdk 6 and jdk 7 because of the property PropertyPanel.isGtk ( true with jdk 6 and false with jdk 7).

The property is true in jdk 6 and false in jdk 7 because the parent hierarchy of NimbusLookAndFeel changed beetween these 2 versions. I don't know if it's a wanted behavior or if it's a bug. If you launch your application with jre 6 then jre 7, you'll notice some differences in the backround color of panel containing the button "...".

Here is a"feedback" of the Netbeans profiler ( an image is attached) .
http://forums.netbeans.org/files/synth_137.png
Maybe YourKit will be more accurate :)


The problem could come from:
javax.swing.plaf.synth.SynthTableUI.update(JComponent)
and
PropertyPanel.paint(java.awt.Graphics)

In the comment of the method PropertyPanel.paint there is a comment concerning Synth and a specific behavior is implemented:


Code:

public void paint(Graphics g) {
         if (isGtk) {
             //Presumably we can get this fixed for JDK 1.5.1
             Color c = getBackground();

             if (c == null) {
                 c = UIManager.getColor("control"); //NOI18N
             }

             if (c == null) {
                 c = Color.LIGHT_GRAY;
             }

             g.setColor(c);
             g.fillRect(0, 0, getWidth(), getHeight());
         }

         super.paint(g);
     }



AFAIK, overriding the paint method is not the best solution:the method paintComponent is a better candidate... But there must be a good reason...




Attachments:
http://forums.netbeans.org//files/synth_137.png







[platform-dev] Re: Performance issue with OutlineView

(continued)

[platform-dev] Re: Performance issue with OutlineView

Frédéric Deniger 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

Frédéric Deniger 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

imavroukakis 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

imavroukakis 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

frederic.deniger 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

Johannes Boesl 11/22/2012

[platform-dev] Re: Performance issue with OutlineView

frederic.deniger 11/23/2012

[platform-dev] Re: Re: Performance issue with OutlineView

Frédéric Deniger 11/23/2012

[platform-dev] Re: Re: Performance issue with OutlineView

Johannes Boesl 11/23/2012

[platform-dev] Re: Re: Performance issue with OutlineView

Frédéric Deniger 11/23/2012

[platform-dev] Re: Re: Performance issue with OutlineView

Frédéric Deniger 11/23/2012

Project Features

Project Links

About this Project

Platform was started in November 2009, is owned by Antonin Nebuzelsky, and has 138 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close