Compare with

Comparison of EclipseLink with H2 server vs OpenJPA with MySQL 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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test5.63.92.51.64.02.7
Element Collection Test4.21.61.50.682.81.1
Inheritance Test6.63.62.11.44.42.5
Indexing Test9.75.64.12.46.94.0
Graph (Binary Tree) Test4.70.683.50.574.10.63
Multithreading Test10.27.24.02.77.14.9
All Tests6.83.72.91.54.92.6

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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test5.53.28.222.76.812.9
Element Collection Test3.20.00384.22.93.71.4
Inheritance Test4.70.01710.16.97.43.4
Indexing Test4.42.49.423.46.912.9
Graph (Binary Tree) Test1.10.271.90.351.50.31
Multithreading Test12.20.1415.918.114.09.1
All Tests5.21.08.312.46.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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test3.89.31.12.22.55.8
Element Collection Test4.14.81.11.12.62.9
Inheritance Test3.21.51.30.902.31.2
Indexing Test3.00.318.02.15.51.2
Multithreading Test1.11.91.00.991.11.4
All Tests3.03.62.51.52.82.5

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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test4.50.742.21.63.41.2
Element Collection Test3.80.0142.41.73.10.87
Inheritance Test4.40.0483.02.03.71.0
Indexing Test4.20.743.13.03.71.9
Graph (Binary Tree) Test1.40.450.790.251.10.35
Multithreading Test7.80.552.52.95.11.7
All Tests4.30.422.31.93.31.2

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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test6.40.983.11.74.81.4
Element Collection Test3.00.00991.30.652.20.33
Inheritance Test5.60.0332.81.54.20.75
Indexing Test10.30.643.82.07.01.3
Graph (Binary Tree) Test1.50.411.30.431.40.42
Multithreading Test7.00.274.92.96.01.6
All Tests5.60.392.91.54.30.96

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
 EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
Basic Person Test5.23.63.46.04.34.8
Element Collection Test3.61.32.11.42.91.3
Inheritance Test4.91.03.92.54.41.8
Indexing Test6.31.95.76.66.04.3
Graph (Binary Tree) Test2.10.451.90.402.00.43
Multithreading Test7.72.05.75.56.73.8
All Tests5.11.83.83.94.52.8

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