I have used this benchmark java8-lambda-performance-test and when running it I have done the followings:
1.Disabled Intrinsic usage
2.Disabled Inlining
3.Disabled Compiling mode
I have found out that disabling the two first optimizations has no effect on results.
Which is strange, and also when running the benchmark with and print intrinsic, I did not find any call to the intrinsic compiledLambdaForm
Since maths intrinsics are heavily used there _min,_pow... I was expecting that disabling intrinsics would have slown the performance
I don't think that there is any effect of the intrinsics, because Lambda expressions uses mainly the class
LambdaMetaFactory.
So that is why both inlining and intrinsics has no effect on the lambda itself.Now for the maths intrinsics my believe is that since they are only used in the identity method,which is only used in the case of
LambdaExtraAverage
andLambdaExtraSerial
tests then they will not affect much the benchmark results.The reason why you haven't noticed an expected performance effect is poorly written benchmark.
I rewrote the benchmark using JMH and the things finally got right.
Here are the results:
As expected, the benchmark with
-XX:-Inline
works 70% longer, and the version with Math intrinsics disabled appears to be 60 times slower!