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

RFE: Inefficient reading of html32.bdtd in javax.swing.text.html package

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.0
    • client-libs
    • beta
    • generic
    • generic



      Name: rlT66838 Date: 09/02/99


      Loading/parsing the html32.bdtd file is done using unbuffered 1 byte
      reads. This can slow down startup of swing applications; one example
      is 'SwingSet' (during SwingSet startup, you'll notice a relatively
      long pause during the "Loading HTML Text Example" initialization
      phase).

      The problem can be reproduced with truss as follows:

        % mkdir /tmp/marker
        % cd /opt/jdk1.2.2/demo/jfc/SwingSet
        % truss -o /tmp/java.truss /opt/jdk1.2.2/bin/java -Xbootclasspath:/tmp/marker:/opt/jdk1.2.2/jre/lib/rt.jar -jar SwingSet.jar

      In the truss output file /tmp/java.truss, search for the string
      'html32.bdtd'. Soon after the classloader checks for the file
      /tmp/marker/javax/swing/text/html/parser/html32.bdtd, the following
      sequence of system calls can be observed:

      stat("/tmp/marker/javax/swing/text/html/parser/html32.bdtd", 0xFFBECE88) Err#2 E
      NOENT
      resolvepath("/opt/jdk1.2.2/jre/lib/rt.jar", "/opt/jdk1.2.2/jre/lib/rt.jar", 1024
      ) = 28
      llseek(3, 4073891, SEEK_SET) = 4073891
      read(3, " P K0304\n\0\0\0\0\083 ".., 30) = 30
      llseek(3, 4073961, SEEK_SET) = 4073961
      read(3, "\0", 1) = 1
      llseek(3, 4073962, SEEK_SET) = 4073962
      read(3, "\0", 1) = 1
      llseek(3, 4073963, SEEK_SET) = 4073963
      read(3, "\0", 1) = 1
      llseek(3, 4073964, SEEK_SET) = 4073964
      read(3, "01", 1) = 1
      llseek(3, 4073965, SEEK_SET) = 4073965
      read(3, "01", 1) = 1
      llseek(3, 4073966, SEEK_SET) = 4073966
      read(3, " P", 1) = 1
      llseek(3, 4073967, SEEK_SET) = 4073967
      read(3, "\0", 1) = 1
      llseek(3, 4073968, SEEK_SET) = 4073968
      read(3, "06", 1) = 1
      llseek(3, 4073969, SEEK_SET) = 4073969
      read(3, " A", 1) = 1
      llseek(3, 4073970, SEEK_SET) = 4073970
      read(3, " a", 1) = 1
      llseek(3, 4073971, SEEK_SET) = 4073971
      read(3, " c", 1) = 1
      llseek(3, 4073972, SEEK_SET) = 4073972
      read(3, " u", 1) = 1
      llseek(3, 4073973, SEEK_SET) = 4073973
      read(3, " t", 1) = 1
      llseek(3, 4073974, SEEK_SET) = 4073974
      read(3, " e", 1) = 1

      and so on...

      This is obviously not a very efficient way to sequentially read a
      file!
      (Review ID: 94440)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: