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

Solaris sparc: serious slowdown in array creation since build 46

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • CPU:
      sparc
    • OS:
      solaris_7

      Description

      I'm not sure that this is the right category, so
      please reassign as needed.

      Merlin build used:
      java version "1.4.0-beta_refresh"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b67)
      Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b67, mixed mode)

      I've noticed a serious - 10x for some cases - slowdown for some operations, like
      arrays creation, in comparison to 1.3.1 (and earlier merlin builds).
      The problem first appeared in Merlin build 47. The vm (classic/client/int)
      doesn't matter.

      Here is a test case:
      -------------
      import javax.swing.JFrame;
      import java.util.Date;

      public class Test {
          static private long start, end, total = 0;
          static final int SIZE = 500*500;
          public static void main(String[] args) {
      if (args.length > 0) {
      JFrame f = new JFrame("dd");
      f.pack();
      }
      System.err.println("int:");
              int arr[];
              for (int i = 0; i < 10; i++) {
      start = (new Date()).getTime();
      arr = new int[SIZE];
      end = (new Date()).getTime();
      System.err.println(" time: " + (end - start));
      total += (end - start);
      }

      System.err.println("byte:");
              byte barr[];
              for (int i = 0; i < 10; i++) {
      start = (new Date()).getTime();
      barr = new byte[SIZE];
      end = (new Date()).getTime();
      System.err.println(" time: " + (end - start));
      total += (end - start);
      }
              System.err.println("total: " + total);
              System.exit(0);
          }
      }
      -------------

      Run it with 1.3.1:
      #>/usr/local/java/jdk1.3.1/solsparc/bin/java Test
      int:
       time: 13
       time: 13
       time: 12
       time: 7
       time: 3
       time: 4
       time: 4
       time: 3
       time: 3
       time: 4
      byte:
       time: 1
       time: 0
       time: 2
       time: 1
       time: 2
       time: 1
       time: 1
       time: 2
       time: 1
       time: 1
      total: 78

      With 1.4 b67:
      #>/usr/local/java/jdk1.4/solsparc/bin/java Test
      int:
       time: 16
       time: 40
       time: 31
       time: 32
       time: 45
       time: 32
       time: 32
       time: 32
       time: 32
       time: 32
      byte:
       time: 4
       time: 30
       time: 1
       time: 1
       time: 1
       time: 1
       time: 25
       time: 1
       time: 1
       time: 1
      total: 390

      As you can see, for int arrays of size 500x500 it's almost 10 times slower.

      Even more interesting, run the same test with any parameter - it will then
      create a Swing JFrame and realize it. The difference in time taken in this case
      is even more dramatic:
      #>/usr/local/java/jdk1.3.1/solsparc/bin/java Test d
      int:
       time: 46
       time: 4
       time: 8
       time: 6
       time: 3
       time: 3
       time: 4
       time: 3
       time: 3
       time: 2
      byte:
       time: 2
       time: 0
       time: 1
       time: 1
       time: 1
       time: 1
       time: 1
       time: 1
       time: 2
       time: 0
      total: 92

      and 1.4:
      #>/usr/local/java/jdk1.4/solsparc/bin/java Test d
      int:
       time: 137
       time: 121
       time: 113
       time: 159
       time: 116
       time: 120
       time: 114
       time: 121
       time: 115
       time: 114
      byte:
       time: 4
       time: 10
       time: 112
       time: 1
       time: 1
       time: 1
       time: 1
       time: 1
       time: 114
       time: 2
      total: 1477

      dmitri.trembovetski@eng 2001-06-11

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jloizeausunw Jane Loizeaux (Inactive)
              Reporter:
              tdv Dmitri Trembovetski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: