Compare with

Comparison of OpenJPA with MySQL server vs EclipseLink with H2 server

Each of the following tables focuses on a specific database operation, where the last table presents average results comparison.

Speed comparison of JPA database persistence operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test3.95.61.62.52.74.0
Element Collection Test1.64.20.681.51.12.8
Inheritance Test3.66.61.42.12.54.4
Indexing Test5.69.72.44.14.06.9
Graph (Binary Tree) Test0.684.70.573.50.634.1
Multithreading Test7.210.22.74.04.97.1
All Tests3.76.81.52.92.64.9

The results above show that in general EclipseLink with H2 server is more efficient than OpenJPA with MySQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.68) to the normalized speed of EclipseLink with H2 database server (4.7) reveals that in that case, EclipseLink with H2 server is 6.9 times faster than OpenJPA with MySQL server.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test3.25.522.78.212.96.8
Element Collection Test0.00383.22.94.21.43.7
Inheritance Test0.0174.76.910.13.47.4
Indexing Test2.44.423.49.412.96.9
Graph (Binary Tree) Test0.271.10.351.90.311.5
Multithreading Test0.1412.218.115.99.114.0
All Tests1.05.212.48.36.76.7

The results above show that in general EclipseLink with H2 server is equivalent to OpenJPA with MySQL server in retrieving JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0038) to the normalized speed of EclipseLink with H2 database server (3.2) reveals that in that case, EclipseLink with H2 server is 842 times faster than OpenJPA with MySQL server.

On the other hand, EclipseLink with H2 server is slower, for instance, when using simple basic entities with large retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (8.2) to the normalized speed of OpenJPA with MySQL database server (22.7) reveals that in that case, EclipseLink with H2 server is 2.8 times slower than OpenJPA with MySQL server.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test9.33.82.21.15.82.5
Element Collection Test4.84.11.11.12.92.6
Inheritance Test1.53.20.901.31.22.3
Indexing Test0.313.02.18.01.25.5
Multithreading Test1.91.10.991.01.41.1
All Tests3.63.01.52.52.52.8

The results above show that in general EclipseLink with H2 server is slightly more efficient than OpenJPA with MySQL server in executing the tested JPA queries.

A large performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.31) to the normalized speed of EclipseLink with H2 database server (3.0) reveals that in that case, EclipseLink with H2 server is 9.7 times faster than OpenJPA with MySQL server.

On the other hand, EclipseLink with H2 server is slower, for instance, when using simple basic entities with small retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (3.8) to the normalized speed of OpenJPA with MySQL database server (9.3) reveals that in that case, EclipseLink with H2 server is 2.4 times slower than OpenJPA with MySQL server.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test0.744.51.62.21.23.4
Element Collection Test0.0143.81.72.40.873.1
Inheritance Test0.0484.42.03.01.03.7
Indexing Test0.744.23.03.11.93.7
Graph (Binary Tree) Test0.451.40.250.790.351.1
Multithreading Test0.557.82.92.51.75.1
All Tests0.424.31.92.31.23.3

The results above show that in general EclipseLink with H2 server is more efficient than OpenJPA with MySQL server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with MySQL database server (1.2) to the normalized speed of EclipseLink with H2 database server (3.3) reveals that in these tests, EclipseLink with H2 server is 2.8 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.014) to the normalized speed of EclipseLink with H2 database server (3.8) reveals that in that case, EclipseLink with H2 server is 271 times faster than OpenJPA with MySQL server.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test0.986.41.73.11.44.8
Element Collection Test0.00993.00.651.30.332.2
Inheritance Test0.0335.61.52.80.754.2
Indexing Test0.6410.32.03.81.37.0
Graph (Binary Tree) Test0.411.50.431.30.421.4
Multithreading Test0.277.02.94.91.66.0
All Tests0.395.61.52.90.964.3

The results above show that in general EclipseLink with H2 server is much more efficient than OpenJPA with MySQL server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with MySQL database server (0.96) to the normalized speed of EclipseLink with H2 database server (4.3) reveals that in these tests, EclipseLink with H2 server is 4.5 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0099) to the normalized speed of EclipseLink with H2 database server (3.0) reveals that in that case, EclipseLink with H2 server is 303 times faster than OpenJPA with MySQL server.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test3.65.26.03.44.84.3
Element Collection Test1.33.61.42.11.32.9
Inheritance Test1.04.92.53.91.84.4
Indexing Test1.96.36.65.74.36.0
Graph (Binary Tree) Test0.452.10.401.90.432.0
Multithreading Test2.07.75.55.73.86.7
All Tests1.85.13.93.82.84.5

The results above show that in general EclipseLink with H2 server is more efficient than OpenJPA with MySQL server in performing JPA database operations.

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (1.0) to the normalized speed of EclipseLink with H2 database server (4.9) reveals that in that case, EclipseLink with H2 server is 4.9 times faster than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons