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

MeteredStream.read() is horribly inefficient.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.0
    • 1.0
    • core-libs
    • None
    • 1.0.k
    • generic
    • generic
    • Not verified

      The MeteredStream class is used extensively throughout HotJava to
      provide GUI feedback on the status of network connections. It is
      unfortunately very inefficient, and causes HotJava and other systems
      to suffer as a result.

      What's the problem? It forces an update() on every single read(),
      including byte-at-a-time reads. And update() is very expensive
      GUI operation, both in terms of memory and CPU cycles.

      There are many users of MeteredStream that read data byte-at-a-time.
      Just fire up HotJava and do an AltaVista search. Notice how slowly
      the results page is parsed. Surf to Gamelan. Notice how slowly the
      sitemap data is downloaded.

      Then if you really want to have some fun, try running the java-harness
      in HotJava. What should normally take half an hour takes a whole
      weekend.

      Get the picture?

      It seems incredibly silly that MeteredStream updates its friendly gooey
      graphs for every single byte read. Even if it's a 50KB stream we're
      reading. Lets see, reading 50KB would then result in 51200 updates
      of the nice little graph. I think I see a performance problem.

      stuart.ritchie@Eng 1996-11-23

            djbrown David Brown (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: