Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink 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
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test17.13.65.81.511.52.6
Element Collection Test10.91.54.90.697.91.1
Inheritance Test14.33.55.91.410.12.4
Indexing Test24.45.313.72.519.13.9
Graph (Binary Tree) Test6.81.76.71.36.71.5
Multithreading Test34.27.210.22.422.24.8
All Tests17.93.87.91.612.92.7

The results above show that in general OpenJPA with H2 embedded is much more efficient than EclipseLink with MySQL server in persisting JPA entity objects to the database. Comparing the normalized speed of EclipseLink with MySQL database server (2.7) to the normalized speed of OpenJPA with H2 embedded database (12.9) reveals that in these tests, OpenJPA with H2 embedded is 4.8 times faster than EclipseLink with MySQL server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test14.60.4327.215.520.98.0
Element Collection Test0.00460.164.31.42.10.78
Inheritance Test0.0110.397.417.63.79.0
Indexing Test17.00.4335.016.626.08.5
Graph (Binary Tree) Test1.00.531.40.761.20.65
Multithreading Test18.70.1927.611.023.15.6
All Tests8.60.3517.110.512.85.4

The results above show that in general OpenJPA with H2 embedded is more efficient than EclipseLink with MySQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of EclipseLink with MySQL database server (5.4) to the normalized speed of OpenJPA with H2 embedded database (12.8) reveals that in these tests, OpenJPA with H2 embedded is 2.4 times faster than EclipseLink with MySQL server.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (0.19) to the normalized speed of OpenJPA with H2 embedded database (18.7) reveals that in that case, OpenJPA with H2 embedded is 98.4 times faster than EclipseLink with MySQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of EclipseLink with MySQL database server (0.39) reveals that in that case, OpenJPA with H2 embedded is 35.5 times slower than EclipseLink with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test5.01.51.10.443.10.95
Element Collection Test1.71.41.30.431.50.92
Inheritance Test2.21.11.20.611.70.86
Indexing Test13.80.2623.20.5218.50.39
Multithreading Test1.41.90.600.720.991.3
All Tests4.81.25.50.545.10.88

The results above show that in general OpenJPA with H2 embedded is much more efficient than EclipseLink with MySQL server in executing the tested JPA queries. Comparing the normalized speed of EclipseLink with MySQL database server (0.88) to the normalized speed of OpenJPA with H2 embedded database (5.1) reveals that in these tests, OpenJPA with H2 embedded is 5.8 times faster than EclipseLink with MySQL server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test10.00.396.01.88.01.1
Element Collection Test0.0110.233.81.41.90.83
Inheritance Test0.0460.425.02.62.51.5
Indexing Test8.90.467.03.18.01.8
Graph (Binary Tree) Test2.40.671.30.411.90.54
Multithreading Test16.60.484.32.610.41.5
All Tests6.30.444.62.05.41.2

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (0.48) to the normalized speed of OpenJPA with H2 embedded database (16.6) reveals that in that case, OpenJPA with H2 embedded is 34.6 times faster than EclipseLink with MySQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of EclipseLink with MySQL database server (0.23) reveals that in that case, OpenJPA with H2 embedded is 20.9 times slower than EclipseLink with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test18.30.3511.11.714.71.0
Element Collection Test0.0120.112.90.511.40.31
Inheritance Test0.0300.296.61.63.30.94
Indexing Test23.20.469.71.916.41.2
Graph (Binary Tree) Test1.80.542.40.492.10.51
Multithreading Test31.20.3117.33.624.21.9
All Tests12.40.348.31.610.40.98

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (0.31) to the normalized speed of OpenJPA with H2 embedded database (31.2) reveals that in that case, OpenJPA with H2 embedded is 101 times faster than EclipseLink with MySQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.030) to the normalized speed of EclipseLink with MySQL database server (0.29) reveals that in that case, OpenJPA with H2 embedded is 9.7 times slower than EclipseLink with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
Basic Person Test13.01.310.24.211.62.7
Element Collection Test2.50.693.40.893.00.79
Inheritance Test3.31.15.24.84.32.9
Indexing Test17.51.417.74.917.63.2
Graph (Binary Tree) Test3.00.853.00.733.00.79
Multithreading Test20.42.012.04.016.23.0
All Tests10.21.28.83.39.52.3

The results above show that in general OpenJPA with H2 embedded is much more efficient than EclipseLink with MySQL server in performing JPA database operations. Comparing the normalized speed of EclipseLink with MySQL database server (2.3) to the normalized speed of OpenJPA with H2 embedded database (9.5) reveals that in these tests, OpenJPA with H2 embedded is 4.1 times faster than EclipseLink with MySQL server.

A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (1.4) to the normalized speed of OpenJPA with H2 embedded database (17.5) reveals that in that case, OpenJPA with H2 embedded is 12.5 times faster than EclipseLink with MySQL server.

Other Head to Head DBMS/JPA Comparisons