Java 8性能VS. Java 7 [英] Java 8 performance VS. Java 7

查看:147
本文介绍了Java 8性能VS. Java 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过JNI使用C ++库开发一个成像处理Java 7u80应用程序。



因为我愿意


I'm developing a imaging processing Java 7u80 application using C++ libraries through JNI.

As I was willing to execute streams in parallel with Java 8u60, I just switched to JDK 8 and relaunched all my unit tests.

Java 8u60 Overall duration: **35'408 [ms]**
Java 7u80 Overall duration: **29'581 [ms]**

Java 7 is in my case 17% faster than Java 8 (same code, code level resp. 7 and 8).

  1. I was wondering if such result may be specific to my application or if others have already notice a downgrade of the performance moving form Java 7 to 8?
  2. Are there particular optimization to do in the code to get the best of Java 8?

If nothing can be done, I would then rather implement the multithreading code with Java 7 rather than 8, to keep the performance gain I already have with Java 7.

解决方案

Launched 21 SOAPUI (Parallel) tests against WLS 12.1.3 running resp. Java 7u51(*) and Java 8u60 on my test environment.

Test results below (screenshots included in case of).

To summarize: SOAPUI time is simply the SOAPUI execution time for each pass, while
the JMX time (cumulative between each pass) is the time spend on the critical part of my application.
The JMX metrics is the computational time (the one I try to minimize). I won't rely on the SOAPUI metric as I don't know how it is calculated exactly

As per SOAPUI, JDK 7u51 was 6.7% faster than JDK 8u60.
As per JMX, JDK 7u51 was 15.6% faster than JDK 8u60.

The latter confirm (to me) the trend observed in my unit tests - same result. Despite these tests are probably not the one to use to evaluate a JVM performance, I guess that in my case scenario, it is preferable to stay on JDK7, as in my case, the performance aspect is important.

Java 7
Pass1 SOAPUI: 22'324 [ms] - JMX :16'286 [ms]
Pass2 SOAPUI: 24'129 [ms] - JMX :33'510 [ms]
Pass3 SOAPUI: 22'170 [ms] - JMX :49'923 [ms]
TOTAL SOAPUI: 68'623 [ms] (JMX: 49'923 [ms])

Java 8
Pass1 SOAPUI: 25'150 [ms] - JMX :19'767 [ms]
Pass2 SOAPUI: 24'564 [ms] - JMX :39'702 [ms]
Pass3 SOAPUI: 23'846 [ms] - JMX :59'172 [ms]
TOTAL SOAPUI: 73'560 [ms] (JMX: 59'172 [ms])

(*): no time to install Java 7u60 as in my unit test

Screenshots

这篇关于Java 8性能VS. Java 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆