[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    Integrated: 8273585: String.charAt performance degrades due to JDK-8268698
From:       Yi Yang <yyang () openjdk ! java ! net>
Date:       2021-10-27 1:27:12
Message-ID: W--yuM9fvkx6INbXw98yBllv0EcweUAdpgkeK4GAOqQ=.ff60de9e-460a-4cf9-9051-ad3b4ce67698 () github ! com
[Download RAW message or body]

On Mon, 25 Oct 2021 05:52:02 GMT, Yi Yang <yyang@openjdk.org> wrote:

> String.charAt shows significant performance regression due to \
> [JDK-8268698](https://bugs.openjdk.java.net/browse/JDK-8268698), which replaces \
> index bound checking with Preconditions.checkIndex intrinsic method. 
> The result of "time linux-x86_64-server-release/images/jdk/bin/java Test":
> 
> 
> Before JDK-8268698
> real 0m8.369s
> user 0m8.386s
> sys 0m0.019s
> 
> After JDK-8268698,
> real 0m19.722s
> user 0m19.748s
> sys 0m0.013s
> 
> 
> The reason is Preconditions.checkIndex generates a CastII for index node as index \
> is now known to be >= 0 and < length.: 
> https://github.com/openjdk/jdk/blob/5dab76b939e381312ce5c89b9aebca628238a387/src/hotspot/share/opto/library_call.cpp#L1077-L1083
>  
> CastII can not be recognized as a parallel induction variable because AddNode's \
> input must be the PhiNode: 
> https://github.com/openjdk/jdk/blob/5dab76b939e381312ce5c89b9aebca628238a387/src/hotspot/share/opto/loopnode.cpp#L3177-L3184
>  
> It seems this prevents further loop unrolling. I think we can relax this \
> constraint, i.e CastII can be the input of AddNode if its input is PhiNode. After \
> applying this patch, performance regression disappears: 
> 
> $time ./test.sh 
> 
> real    0m9.514s
> user    0m10.310s
> sys     0m0.155s
> 
> This is likely the reason for \
> [JDK-8272493](https://bugs.openjdk.java.net/browse/JDK-8272493). Please help review \
> it. Thanks!

This pull request has now been integrated.

Changeset: b0d1e4ff
Author:    Yi Yang <yyang@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/b0d1e4ff4d3806851fe998717822e8e52987357c
                
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8273585: String.charAt performance degrades due to JDK-8268698

Reviewed-by: roland, kvn

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

PR: https://git.openjdk.java.net/jdk/pull/6096


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic