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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 7
    • Affects Version/s: 7
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: