RFR: 8325169: Reduce String::indexOf overheads

Claes Redestad redestad at openjdk.org
Fri Feb 2 14:59:11 UTC 2024


This patch streamlines and specializes various `String::indexOf` methods. Mainly avoids the need for clamping and doing checks that are redundant in almost all cases, moving the checks to the API boundary where they are needed. 

This improves performance both at peak and during startup/warmup. Since indexOf is heavily used in bootstrapping code it makes sense to slightly dial back abstraction and delegation, which in this case also brought some benefit to peak performance.

Testing: tier1-3

-------------

Commit messages:
 - Reduce String.indexOf overheads

Changes: https://git.openjdk.org/jdk/pull/17685/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17685&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325169
  Stats: 36 lines in 4 files changed: 17 ins; 15 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/17685.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17685/head:pull/17685

PR: https://git.openjdk.org/jdk/pull/17685


More information about the core-libs-dev mailing list