[intrinsics] performance improvements for the intrinsified version of Objects::hash

Aleksey Shipilev shade at redhat.com
Fri Mar 15 10:05:16 UTC 2019


On 3/15/19 3:13 AM, Vicente Romero wrote:
> Please see the performance of both implementations for the multi-threaded version [1].
> 
> [1]
> http://cr.openjdk.java.net/~vromero/intrinsics_benchmark_results/v9/benchmarkResults_intrinsics_all_data_v9.html

I'd drop "volatile" qualifier from the fields you are reading from. "volatile" (acquire) semantics
probably breaks some optimizations, and might not be the overwhelmingly common case for hashCode
computations. JMH breaks the folding across @Benchmark calls already. It might not matter that much
for the tests where you read all the fields and then call into Objects.hash, but better be safe than
sorry.

-Aleksey



More information about the amber-dev mailing list