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

StringLatin1 should consistently use CharacterDataLatin1.instance when applicable

    Details

    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      Using CharacterDataLatin1.instance explicitly in StringLatin1 can be an optimization, especially during startup/warmup, by avoiding the indirection of calling into Character.of(ch). This optimization is already implemented in some places, but we should take advantage of it consistently within java.lang.StringLatin1.

      Tests using StringUpperLower microbenchmark show a 1.5-2x speed-up when running with -Xint or -XX:TieredStopAtLevel=1 (C1), with no difference in peak performance when running with out-of-the-box C2 (this is expected after sufficient inlining for the JIT to see which paths unconditionally flow down to CharacterDataLatin1.instance).

        Attachments

          Activity

            People

            • Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: