RFR: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo [v2]

Wu Yan wuyan at openjdk.java.net
Wed Jul 28 07:53:27 UTC 2021


On Mon, 12 Jul 2021 15:36:29 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Wang Huang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   draft of refactor
>
> And with longer strings, M1 and ThunderX2:
> 
> 
> Benchmark                                       (diff_pos)  (size)  Mode  Cnt   Score   Error  Units
> StringCompare.compareLLDiffStrings                    1023    1024  avgt    3  50.849 ± 0.087  us/op
> StringCompare.compareLLDiffStringsWithLdp             1023    1024  avgt    3  23.676 ± 0.015  us/op
> StringCompare.compareLLDiffStringsWithRefactor        1023    1024  avgt    3  28.967 ± 0.168  us/op
> 
> 
> StringCompare.compareLLDiffStrings                    1023    1024  avgt    3  98.681 ± 0.026  us/op
> StringCompare.compareLLDiffStringsWithLdp             1023    1024  avgt    3  82.576 ± 0.656  us/op
> StringCompare.compareLLDiffStringsWithRefactor        1023    1024  avgt    3  98.801 ± 0.321  us/op
> 
> LDP wins on M1 here, but on ThunderX2 it makes almost no difference at all. And how often are we comparing such long strings?
> I don't know what to think, really. It seems that we're near to a place where we're optimizing for micro-architecture, and I don't want to see that here. On the other hand, using LDP is not worse anywhere, so we should allow it.

Could you do me a favor to review the patch? @theRealAph @nick-arm Thanks.

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

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


More information about the core-libs-dev mailing list