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

Speed up various String comparison methods with ArraysSupport.mismatch

    XMLWordPrintable

Details

    • b10

    Description

      During review of https://github.com/openjdk/jdk/pull/12290 we observed that `startsWith` does not optimize as well as `equals`, due a lack of intrinsic support. An experiment there showed that special-casing `startsWith` to delegate to `equals` if the lengths matches is a speed-up, but perhaps it can be adapted to use `Arrays.mismatch`/`ArraysSupport.vectorizedMismatch` directly with a speed-up for all cases.

      Investigating other methods in String, like compare, might see similar opportunities.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: