Is there a performance difference between Oracle JDK and OpenJDK at the end of 2017?

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.

Summary

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

Is there a performance difference between Oracle JDK and OpenJDK at the end of 2017?
What is the difference between a class and a struct? ?? ??
What is the difference between a web server and an application server?
What is the difference between SimpleDateFormat and DateTimeFormatter? ??
What is the difference between System Spec and Feature Spec?
[Rails] What is the difference between redirect and render?
[JAVA] What is the difference between interface and abstract? ?? ??
What is the difference between skip and pending? [RSpec]
What is the difference between Java EE and Jakarta EE?
Understand in 3 minutes! A very rough explanation of the difference between session and cookie
[Rails] What is the difference between bundle install and bundle update?
[Ruby] About the difference between 2 dots and 3 dots of range object.
What is the difference between an action and an instance method?
Why put a line break at the end of the file
What is the difference between the responsibilities of the domain layer and the application layer in the onion architecture [DDD]
[Ruby] Difference between symbol variables and character string variables. About the difference between [: a] and ['a'].
Understand the difference between each_with_index and each.with_index
This and that of the JDK
[Java] What is the difference between form, entity and dto? [Bean]
The difference between puts and print in Ruby is not just the presence or absence of line breaks
[Rails] Difference in behavior between delegate and has_many-through in the case of one-to-one-to-many
The content of the return value of executeBatch is different between 11g and 12c
There is a copy / paste programmer-look at someone and look back at me
Get a rough idea of the differences between protocols, classes and structs!
A look at Jenkins, OpenJDK 8 and Java 11
Is there a numeric version of include?
Difference between isEmpty and isBlank of StringUtils
About the difference between irb and pry
Difference between addPanel and presentModally of FloatingPanel
Find the difference from a multiple of 10
[Java] Difference between equals and == in a character string that is a reference type
[Oracle Cloud] Install the free Oracle JDK 11 (LTS) on a virtual instance of OCI
Let's explain the difference between an interpreter and a compiler using a Venn diagram
Shows how many years and months the difference from a particular date is
[Java] Understand the difference between List and Set
Check the version of the JDK installed and the version of the JDK enabled
[Rails / ActiveRecord] About the difference between create and create!
Understand the difference between abstract classes and interfaces!
Difference between member and collection of rails routes.rb
The end of catastrophic programming # 03 "Comparison of integers, if" a> b ", assume that it is" a --b> 0 ""
[For Ruby beginners] What is the difference between puts print p? Actually, there is a clear way to use it properly!
[Ruby] I thought about the difference between each_with_index and each.with_index
[Rails] I learned about the difference between resources and resources
The comparison of enums is ==, and equals is good [Java]
About the difference between classes and instances in Ruby
Calculate the difference between numbers in a Ruby array
Behavior is different between new and clear () of ArrayList
Compare the difference between dockerfile before and after docker-slim
Verification of the relationship between Docker images and containers
[Rails] I investigated the difference between redirect_to and render.
[Swift] UITextField taught me the difference between nil and ""
I will explain the difference between Android application development and iOS application development from the perspective of iOS engineers
Now in the third year, the misunderstanding that I noticed is the difference between the equals method and ==