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

(fmt) Optimize Formatter.parse (including String.printf)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 7
    • core-libs
    • None
    • b77
    • generic
    • generic

      http://cr.openjdk.java.net/~martin/webrevs/openjdk7/Formatter.parse/

      Synopsis: Optimize Formatter.parse (including String.printf)
      Description:
      Formatter is not as efficient as it could be.
      Here's a low-hanging fruit optimization
      that creates fewer objects,
      and uses the idiom

      return al.toArray(new FormatString[al.size()]);

      I'm sure additional optimizations are possible.

      Results: about 10-20% faster on in-house microbenchmarks of
      String.printf

      Martin

            sherman Xueming Shen
            sherman Xueming Shen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: