RFR: 8244413: Avoid rebinds in MethodHandle.viewAsType
Claes Redestad
claes.redestad at oracle.com
Wed May 6 14:59:39 UTC 2020
On 2020-05-06 00:34, Claes Redestad wrote:
> Hi Mandy,
>
> On 2020-05-06 00:23, Mandy Chung wrote:
>>
>> This looks good.
>
> thanks!
Pushed.
FTR, I took inventory of existing micros, and found a few where
the effect of this change on capturing lambdas can be studied.
For example:
$ make build-microbenchmark
$ java -jar build/linux-x64/images/test/micro/benchmarks.jar
Capture.*lambda_01$ -f 1 -w 1 -r 1
As expected, no statistically significant effect after JIT:
Benchmark Mode Cnt Score Error Units
15-b19 Capture0.lambda_01 avgt 5 5.444 ± 0.872 ns/op
15-b20 Capture0.lambda_01 avgt 5 5.516 ± 1.199 ns/op
jdk Capture0.lambda_01 avgt 5 5.465 ± 1.101 ns/op
-Xint:
Benchmark Mode Cnt Score Error Units
15-b19 Capture0.lambda_01 avgt 5 616.555 ± 2.732 ns/op
15-b20 Capture0.lambda_01 avgt 5 859.594 ± 7.954 ns/op
jdk Capture0.lambda_01 avgt 5 745.150 ± 1.821 ns/op
-XX:TieredStopAtLevel=1:
Benchmark Mode Cnt Score Error Units
15-b19 Capture0.lambda_01 avgt 5 6.312 ± 0.919 ns/op
15-b20 Capture0.lambda_01 avgt 5 105.761 ± 7.575 ns/op
jdk Capture0.lambda_01 avgt 5 105.228 ± 7.175 ns/op
So outside of the direct bootstrap improvement, there's a positive
effect during early warmup. Sadly this patch doesn't translate into an
improvement in C1. I can see a rather large regression in C1 on this
specific micro in 15-b20 (which is where the Hidden Classes integration
happened).
/Claes
More information about the core-libs-dev
mailing list