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

Inline and simplify String*::{coder,value,isLatin1} methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs

      Since Compact Strings implementation, there are simple methods in String and StringBuilders: coder(), value(), isLatin1(). They are mostly there to capture COMPACT_STRINGS settings that would fold to "false" when compact strings are disabled with -XX:-CompactStrings.

      This was to guarantee the same performance when Compact String are unimplemented and/or have surprising performance behaviors. Quite some time had passed since JDK 9 release, and we can consider simplifying these.

      Prototype patch improves the startup performance on Hello World, about 0.5 msec (or ~1.6%) less time spent. The improvement is quite probably more pronunciated on larger workloads, i.e. large application servers.

      Draft PR:
       https://github.com/openjdk/jdk/pull/2334

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: