In the past, there were many articles comparing Oracle JDK and OpenJDK. Even at that time, the two were almost the same, and "the difference between the two will disappear in the future" Material (PDF) There was also .pdf). Also, in the past there was a article like this showing the difference in CPU architecture, that is, the difference in performance between Intel and ARM. And at the end of 2017, Various movements was released by Oracle JDK And in OpenJDK.
By the way, is there a difference in performance between Oracle JDK and OpenJDK even today?
I will verify it. The code is here. I'm CRUDing (creating, browsing, modifying, deleting) data 1000 times in my test code in a Rest API application with Spring Boot. I will measure Oracle OpenJDK 5 times each and 10 times for the system. The version of JDK used is 1.8.0_152, Oracle is here, OpenJDK is here ) To get it.
Mac Run it on your Mac to get started.
MacBook Pro (Retina, 13-inch, Late 2012)
Processor 2.9 GHz Intel Core i7
Memory 8 GB 1600 MHz DDR3
Excerpt from the log. Azul Systems, Inc. is OpenJDK. In total, it is the average of the time it took to complete all cases and the time it took avr to perform one CRUD. Since it is executed in multiple threads, the average * 1000 ≠ the time it took to complete all the cases.
# summary :Oracle Corporation 1.8.0_152, total : 13093, avr :50.50707070707071
# summary :Azul Systems, Inc. 1.8.0_152, total : 13219, avr :51.61749745676501
# summary :Oracle Corporation 1.8.0_152, total : 14221, avr :55.51567239635996
# summary :Azul Systems, Inc. 1.8.0_152, total : 14199, avr :55.383756345177666
# summary :Oracle Corporation 1.8.0_152, total : 14041, avr :54.699195171026155
# summary :Azul Systems, Inc. 1.8.0_152, total : 13726, avr :53.41538461538462
# summary :Oracle Corporation 1.8.0_152, total : 14385, avr :56.066869300911854
# summary :Azul Systems, Inc. 1.8.0_152, total : 12657, avr :49.50912778904665
# summary :Oracle Corporation 1.8.0_152, total : 14370, avr :55.76200204290092
# summary :Azul Systems, Inc. 1.8.0_152, total : 14021, avr :54.15415821501014
Oh, I don't see any significant difference.
Linux x64 I started CentOS with Virtual Box on the above Mac and ran it with CPU 2, Mem 2048.
# summary :Oracle Corporation 1.8.0_152, total : 27041, avr :53.996
# summary :Azul Systems, Inc. 1.8.0_152, total : 28390, avr :56.06406406406406
# summary :Oracle Corporation 1.8.0_152, total : 27767, avr :54.964
# summary :Azul Systems, Inc. 1.8.0_152, total : 27635, avr :54.878
# summary :Oracle Corporation 1.8.0_152, total : 30113, avr :59.563
# summary :Azul Systems, Inc. 1.8.0_152, total : 26138, avr :51.66466466466466
# summary :Oracle Corporation 1.8.0_152, total : 28239, avr :55.88
# summary :Azul Systems, Inc. 1.8.0_152, total : 27637, avr :55.074
# summary :Oracle Corporation 1.8.0_152, total : 28477, avr :56.231
# summary :Azul Systems, Inc. 1.8.0_152, total : 27685, avr :54.856
Similarly, no significant difference was found.
Windows x64 I tried it on Windows 10 on Mac as well.
# summary :Oracle Corporation 1.8.0_152, total : 88932, avr :170.171
# summary :Azul Systems, Inc. 1.8.0_152, total : 104348, avr :207.67
# summary :Oracle Corporation 1.8.0_152, total : 89635, avr :179.223
# summary :Azul Systems, Inc. 1.8.0_152, total : 92882, avr :179.815
# summary :Oracle Corporation 1.8.0_152, total : 84967, avr :165.057
# summary :Azul Systems, Inc. 1.8.0_152, total : 96394, avr :191.677
# summary :Oracle Corporation 1.8.0_152, total : 87724, avr :174.424
# summary :Azul Systems, Inc. 1.8.0_152, total : 83325, avr :164.012
# summary :Oracle Corporation 1.8.0_152, total : 89018, avr :169.627
# summary :Azul Systems, Inc. 1.8.0_152, total : 87105, avr :170.365
It looks like there is no significant difference.
Linux ARM 32 I ran it on Raspberry Pi2 B.
# summary :Oracle Corporation 1.8.0_152, total : 87153, avr :345.167
# summary :Azul Systems, Inc. 1.8.0_152, total : 98166, avr :389.905
# summary :Oracle Corporation 1.8.0_152, total : 86835, avr :345.236
# summary :Azul Systems, Inc. 1.8.0_152, total : 101888, avr :405.66166166166164
# summary :Oracle Corporation 1.8.0_152, total : 85945, avr :342.2522522522523
# summary :Azul Systems, Inc. 1.8.0_152, total : 97561, avr :385.345
# summary :Oracle Corporation 1.8.0_152, total : 87837, avr :345.8416833667335
# summary :Azul Systems, Inc. 1.8.0_152, total : 97551, avr :385.878
# summary :Oracle Corporation 1.8.0_152, total : 86338, avr :343.878
# summary :Azul Systems, Inc. 1.8.0_152, total : 96303, avr :383.2995991983968
Oh! There is a difference! About 10% faster with the Oracke JDK!
Linux ARM 64 I tried it on an ARM single board computer called PINE64.
# summary :Oracle Corporation 1.8.0_152, total : 125477, avr :500.5605605605606
# summary :Azul Systems, Inc. 1.8.0_152, total : 67825, avr :267.8199195171026
# summary :Oracle Corporation 1.8.0_152, total : 123450, avr :492.10854271356783
# summary :Azul Systems, Inc. 1.8.0_152, total : 69810, avr :275.91691691691693
# summary :Oracle Corporation 1.8.0_152, total : 129602, avr :517.0773092369478
# summary :Azul Systems, Inc. 1.8.0_152, total : 67636, avr :265.72754793138245
# summary :Oracle Corporation 1.8.0_152, total : 125981, avr :501.3711133400201
# summary :Azul Systems, Inc. 1.8.0_152, total : 71870, avr :283.9637826961771
# summary :Oracle Corporation 1.8.0_152, total : 127799, avr :507.6098294884654
# summary :Azul Systems, Inc. 1.8.0_152, total : 69773, avr :275.34375
ohhhhhhhh! There is a considerable difference! OpenJDK is about 40% faster! It's amazing.
As of the end of 2017, there was no significant performance difference between Mac, Linux and Windows on Intel. However, a difference was observed on ARM, and the result was that OpenJDK had 40% better performance, especially on 64bit. From now on, it is highly conceivable that ARM, which is superior to power saving, will be used for server applications. If OpenJDK is used at that time, the number of servers can be significantly reduced, which may be an advantage in terms of cost. Furthermore, since there is no difference in performance between the JDKs for each environment, isn't it possible to use OpenJDK for development? How is it? At this time, try using OpenJDK for the development environment, production environment, and all Java runtimes!
Recommended Posts