PrintWriter.print (char c) is very slow.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 1.4.0
    • Affects Version/s: 1.3.0
    • Component/s: core-libs
    • beta
    • generic
    • generic



      Name: skT45625 Date: 07/05/2000


      java version "1.2.2"
      Classic VM (build 1.2.2-L, green threads, javacomp)

      print is implemented as:

      class PrintWriter {
      ...

          public void print(char c) {
      write(String.valueOf(c));
          }

      Which creates a temporary java.lang.String and a char[] for every character
      output. This dramatically slows output though a PrintWriter. The following
      alternative implementation is equivalent and much faster:

          public void print (char c) {
              write (c);
          }
      (Review ID: 106880)
      ======================================================================

            Assignee:
            Michael Mccloskey (Inactive)
            Reporter:
            Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: