Java 7 JVM slower than JRockit 6?

I really wanted to switch to Java 7 (for my own selfish reasons for coding). However, we have users with a very sensitive delay (everything should be a sub-millisecond). I did a simple performance comparison test between 3 different JVMs and found that Java 7 is much slower. The test struck a few simple messages through our application. This test is a low load and load test that pushes one message every few seconds. The results were (in microseconds):

- Hotspot 6 (build 24): msgs= 23 avg= 902 - JRockit 6 (R28 b 29): msgs= 23 avg= 481 - Hotspot 7 (build 04): msgs= 34 avg=1130 

Oracle's strategy is to combine JRockit and Hotspot starting in Java 7 (which is why JRockit 6 is the latest available). Anyone have any ideas why performance is so much worse? (It should be noted that the code was compiled under Java 1.6. Not sure if this will explain this ...)

UPDATE: I voted to close my own question, because from the comments I can see that I can not provide enough information to make this constructive question. Thanks to everyone who commented.

UPDATE: after I return, I thought I would provide more information. The test is always after a new start. All factors are equal for each test. The only thing that changes is the JVM. Repeating the test several times gives a consistent result. There was no GC in any test iteration.

Below are the graphical values ​​of one of the test runs. For JRockit and Hotspot 7, the very first delay value was selected. JRockit has a huge first value, but then very quickly optimizes and settles to the average value. Access Point 7 takes longer to optimize and never drops to a JRockit average. Each data point represents microseconds for reading a message from a TCP / IP socket, executing business logic, and writing a message to another socket. Each message is identical, and no new codes are entered for any message.

JRockit 6 vs. Hotspot 7

+4
source share
2 answers

The main problem with this question was that, ceteris paribus (including JVM arguments) why the same Java code JAR works much slower with JVM Hotspot 7 than with JRockit 6 and Hotspot 6.

This led to several answers regarding whether the time was executed correctly (apparently due to the skepticism of people that there could be the same result between the JVMs). Based on numerous tests, I have no doubt that the measurements are correct.

Potential answers I thought were possible:

  • Java 7 JVM does not run code compiled under Java 6 as fast as the same code compiled under Java 7
  • Java 7 requires new JVM arguments to run in the most optimized mode
  • Other people compared Java 7 to JRockit 6 and saw the same result as me.

Thus, the new Java JVM behavior is very different from our application, all other things being equal. The only resolution is to profile the code against the Java 7 virtual machine to find out where the slow points are in the code. (And perhaps at this point it will be clear that the actual difference between the Java 6 JVM and the Java 7 JVM was / is).

I appreciate all the comments and apologize for not being able to provide enough details for a clear analysis / resolution.

+5
source

JRockit is a proprietary (pure C) code base other than OpenJDK. It contains different garbage collectors and a completely different JIT compiler. One major monetizer, when it belonged to BEA, was a small latent GC, which is quite advanced, even in non-commercial versions. A significant amount of time has been spent on JRockit as a clean room vm implementation. As stated in the comments, this is not so much a matter of merging as overriding things in the HotSpot code base. This is far from a quick process, and some of the things will not work out at all, at least not in their JRockit form. Hungry pieces are not easy to fit without any feed around the edges, so to speak. JDK7 Hotspot, will be good in other things or in different versions of similar systems, however, this may compensate for some of your lost results. Other applications may run faster than with JRockit 6.

If you are interested in learning more about internal JRockit (or any JVM), the book "Oracle JRockit Ultimate Guide" is highly recommended. Full disclosure, I probably get ~ $ 2 pre-tax in each copy and will use it to buy espresso. :)

+10
source

Source: https://habr.com/ru/post/1416233/


All Articles