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

1.1 Date performance improvement

XMLWordPrintable



      Name: bb33257 Date: 03/23/99


      This is only a problem in 1.1.8; it is fixed in 1.2.1.

      The version of Date in 1.1 loads too many dependencies. Just instantiating a Date object pulls in a lot of java.text and java.util. It shouldn't pull in anything until the Date object is used in some way. This is how the 1.2 version works. To diagnose the problem, I ran a simple main() that just instantiates a Date object, under 1.1 and 1.2. Results follow.

      Here's a trace of the 1.1 VM running "main() { new Date(); }":

      (...lots of classes loaded, then...)
      [Loaded java/lang/Runtime.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded .\dateperf.class]
      [Loaded java/util/Date.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/GregorianCalendar.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/Calendar.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/TimeZone.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/NullPointerException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/TimeZoneData.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/SimpleTimeZone.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/InternalError.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/CloneNotSupportedException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/ResourceBundle.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/SystemClassLoader.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/ClassLoader.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/StringIndexOutOfBoundsException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/IndexOutOfBoundsException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/MissingResourceException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/Vector.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/PropertyResourceBundle.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/IllegalArgumentException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/SecurityException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/ClassNotFoundException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/resources/LocaleElements_en.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/util/ListResourceBundle.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/resources/LocaleElements.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/Math.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/NumberFormatException.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/Float.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/Double.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/SimpleDateFormat.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/DateFormat.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/Format.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/DateFormatSymbols.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/resources/DateFormatZoneData_en.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/resources/DateFormatZoneData.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/NumberFormat.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/DecimalFormat.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/DecimalFormatSymbols.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/text/DigitList.class from D:\dev\jdk1.1.8\lib\classes.zip]
      [Loaded java/lang/Long.class from D:\dev\jdk1.1.8\lib\classes.zip]

      Here's a trace of 1.2:

      (...lots of classes loaded, then...)
      [Loaded [Ljava.security.cert.Certificate;]
      [Loaded dateperf]
      [Loaded java.util.Date from D:\dev\jdk1.2.1\jre\lib\rt.jar]
      [Loaded java.lang.ref.Finalizer$3 from D:\dev\jdk1.2.1\jre\lib\rt.jar]

      (Review ID: 55975)

      ======================================================================

            okutsu Masayoshi Okutsu
            bcbeck Brian Beck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: