[aarch64-port-dev ] RFR: AARCH64: optimize string compare intrinsic

Dmitry Samersoff dms at samersoff.net
Wed May 23 15:36:33 UTC 2018


Dmitrij,

Thank you for answering my questions in-person.

The fix looks good to me.

-Dmitry\S


On 28.04.2018 21:29, Dmitrij Pochepko wrote:
> 
> Hi all,
> 
> please review patch for  8202326: AARCH64: optimize string compare
> intrinsic
> 
> This patch introduces string compareTo stub, which uses large loops with
> prefetch instructions. Stub is called for long strings and improves
> String::compareTo up to 4 times on systems without hardware prefetching
> (ThunderX) and up to 2 times on systems with hardware prefetching
> (ThunderX2). Also inlined code is re-arranged with more optimal
> pipelining, which helps in-order systems, so small strings are also
> slightly improved.
> There are no noticeable regressions according to benchmark results.
> 
> I created benchmark to measure improvement:
> http://cr.openjdk.java.net/~dpochepk/8202326/StringCompareBench.java
> 
> Execution matrix is large and can be seen here:
> http://cr.openjdk.java.net/~dpochepk/8202326/str_compare.xls
> 
> Raw results are *.txt files here:
> http://cr.openjdk.java.net/~dpochepk/8202326/
> 
> webrev: http://cr.openjdk.java.net/~dpochepk/8202326/webrev.01/
> 
> CR: https://bugs.openjdk.java.net/browse/JDK-8202326
> 
> testing: I run jtreg hotspot tests: compiler/* gc/* runtime/* using
> fastdebug build and found no new failures. I also run long "bruteforce"
> test which checks all combinations of different character index for all
> strings up to size 512:
> http://cr.openjdk.java.net/~dpochepk/8202326/StrCmpTest.java
> 
> 
> Additional note: this patch depends on zip2 instruction encoding fix:
> JDK-8202395
> 
> Thanks,
> 
> Dmitrij
> 


-- 
Dmitry Samersoff
http://devnull.samersoff.net
* There will come soft rains ...



More information about the aarch64-port-dev mailing list