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

G1: Improve check for string dedup

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b23

      Description

      Currently the G1 evacuation-time test for string deduplication first tests the enable flag. If enabled, it collects some arguments and calls into the dedup handling code. One of the first things done by the dedup handling code is to test whether the object is actually a string, doing nothing if it isn't.

      This is done for every (before JDK-8158045, every non-array after) object. As a result, enabling dedup has a pretty significant cost, since most objects are not strings.

      A better approach is to add a member to G1ParScanThreadState whose value is SystemDictionary::String_klass if dedup is enabled, else nullptr.

      Change the test for dedup to compare the already available klass of the object with the value in that new state member. If not equal then either not a string or dedup is disabled. Otherwise, call into the dedup handling.

      With this change, enabling dedup only imposes a cost on evacuation of strings.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: