Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6392553

Swing performance is significantly lower in 1.5.0_06 than in 1.5.0_05

    XMLWordPrintable

Details

    • 2d
    • x86
    • windows_xp

    Description

      FULL PRODUCT VERSION :
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
      java version "1.5.0_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      IBM ThinkPad R51, Intel Pentium IV Mobile (1.7 Ghz)

      System:
      Graphics Card: ATI Mobility Radeon 9000
        
      Driver:
        Vendor: ATI Technologies Inc.
        Version: 6.14.10.6525
        Date: 22.03.2005

      A DESCRIPTION OF THE PROBLEM :
      On a window of a size at about 1000x800 you can easily see how the painting occures line by line (jre 1.5.0_06). Using jre 1.5.0_05 the drawing of the ui was almost instantly drawn. The effect is visible within all Java-Programs I use.

      I have tried my test on a different pc (a normal workstation) and cannot see
      any difference between jre1.5.0_05 and jre1.5.0_06. It seems to be an
      hardware/driver issue.

      I have extended the test and got some more information out of it. First,
      normally the drawing of the first window takes longer (about factor 5-10)
      than the drawing of subsequent windows. I tried this using jre 1.5.0_05
      jre1.6b69 on my notebook. But if I try this using jre1.5.0_06 on my notebook
      the result differ. The drawing of windows is much slower and does not
      speedup when more windows are opened. Then I tried to turn off ddraw and you
      can see the result below.

      Results: sun.java2d.noddraw

      jre 1.5.0_05
      true false
      130 90
      10 10
      20 20
      10 20
      20 20
      20 10
      10 20
      10 10
      20 20
      20 20

      jre 1.5.0_06
      true false
      70 350
      20 341
      20 341
      20 330
      20 330
      20 341
      20 341
      10 340
      10 340
      10 351

      As you can see turning ddraw off speeds up the drawing significantly.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Take a JFrame and put in a set of components. Maximize the JFrame.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The gui should be instantly updated.
      ACTUAL -
      You can see how the gui is drawn linewise.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Graphics;

      import javax.swing.*;

      public class JFramePaintTest extends JFrame {

          private static final long serialVersionUID = 2936895701046330214L;

          public JFramePaintTest() {
              setSize(1024, 768);
          }

          @Override
          public void paint(Graphics g) {
              long current = System.currentTimeMillis();
              super.paint(g);
              System.out.println(System.currentTimeMillis() - current);
              setVisible(false);
          }

          static JFramePaintTest frame;

          public static void main(String[] args) {
              System.setProperty("sun.java2d.noddraw", "true");
              for (int x = 0; x < 10; x++) {
                  frame = new JFramePaintTest();
                  try {
                      SwingUtilities.invokeAndWait(new Runnable() {
                          public void run() {
                              frame.setVisible(true);
                          }
                      });
                  } catch (Exception e1) {
                      // Ignore
                  }
                  while (frame.isVisible()) {
                      try {
                          Thread.sleep(500);
                      } catch (InterruptedException e) {
                          // Ignore
                      }
                  }
              }
              System.exit(0);
          }
      }
      ---------- END SOURCE ----------

      Attachments

        Activity

          People

            tdv Dmitri Trembovetski (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: