Performance differences between Java 8,, 11, 14 and 16

Peter Firmstone peter.firmstone at zeus.net.au
Wed May 12 07:57:49 UTC 2021


Steps to reproduce:

Use git to checkout https://github.com/pfirmstone/JGDMS.git

Set the following path variables to your Java installation directory:

JAVA_HOME=file path to java 8

JDK_HOME=file path to jdk 8 (same as above)

Make sure the java command returns Java 8.

$java -version

Change directory into JGDMS

$mvn package

Change directory into qa: cd ../qa

Create a file called build.properties

Add the following 2 lines to build.properties (replace with your path):

river.home=C:/Users/peter/Documents/NetBeansProject/JGDMS
run.tests=org/apache/river/test/impl/mahalo/RandomStressTest.td

Then build the qa suite:

$ant build

Then edit the RandomStressTest.td file and add the following line (for 
repeatability)
org.apache.river.test.impl.mahalo.RandomStressTest.seed=1620791630932

Then change JAVA_HOME and JDK_HOME to your preferred version of java, 
and change your path to point to the java version you want to test.

Then run the test:

$ant run-tests

-- 
Regards,
  
Peter Firmstone
Zeus Project Services Pty Ltd.

On 12/05/2021 4:18 pm, Peter Firmstone wrote:
>
> 你好先生范, 不客气,
>
> https://github.com/pfirmstone/JGDMS/blob/trunk/qa/src/org/apache/river/test/impl/mahalo/RandomStressTest.java
>
> https://github.com/pfirmstone/JGDMS/blob/trunk/qa/src/org/apache/river/test/impl/mahalo/RandomStressTest.td
>
> With the follow property set to reproduce:
>
> org.apache.river.test.impl.mahalo.RandomStressTest.seed=1620791630932
>
> 谢谢
>
> -- 
> Regards,
>   
> Peter Firmstone
> Zeus Project Services Pty Ltd.
>
>
> On 12/05/2021 3:42 pm, Xuelei Fan wrote:
>> Hi Peter,
>>
>> For further understanding, may I know more details about the test code?
>>
>> Thanks,
>> Xuelei
>>
>>> On May 11, 2021, at 10:31 PM, Peter Firmstone<peter.firmstone at zeus.net.au>  wrote:
>>>
>>> Just ran some performance stress tests to compare performance between Java 8 and Java 14 with SecurityManager enabled and using TLSv1.3 secure communications.
>>>
>>> On Java 8, AccessController.getStackAccessControlContext[native]() is 7,741ms of process CPU consumption.
>>>
>>> On Java 11, AccessController.getStackAccessControlContext[native]() is 7,769ms of process CPU consumption.
>>>
>>> On Java 14, AccessController.getStackAccessControlContext[native]() is 133,815 ms of process CPU consumption.
>>>
>>> On Java 16, AccessController.getStackAccessControlContext[native]() is 5,144 ms of process CPU consumption.
>>>
>>> I wasn't expecting such a huge difference in performance.
>>>
>>> Total time for the test on Java 8 is 97 seconds.
>>>
>>> Total time for the test on Java 11 is 1 minute 37 seconds (same as Java 8)
>>>
>>> Total time for the test on Java 14 is 2 minutes and 1 second.
>>>
>>> Total time for the test on Java 16 is 1 minute and 36 seconds.
>>>
>>> Both tests are using TLSv1.3 secure communications.
>>>
>>> It would seem that Java 16, 8 and 11 are the performance winners in this case, where the above method is less than 0.5% of CPU. Java 14 is around 15% of CPU.
>>>
>>> Not sure why Java 14 is performing poorly in comparison to other versions, the results are pretty consistent to the second.
>>>
>>> -- 
>>> Regards,
>>> Peter Firmstone
>>> Zeus Project Services Pty Ltd.
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20210512/48577df4/attachment.htm>


More information about the security-dev mailing list