RFR: 8325169: Reduce String::indexOf overheads [v3]

Roger Riggs rriggs at openjdk.org
Mon Feb 5 15:15:07 UTC 2024


On Sat, 3 Feb 2024 14:36:14 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> 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
>
> Claes Redestad has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update comments regarding bounds checks
>  - Clamp fromIndex to be in range

Marked as reviewed by rriggs (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/17685#pullrequestreview-1863061296


More information about the core-libs-dev mailing list