Compare with

Comparison of EclipseLink with MySQL server vs OpenJPA with H2 embedded

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
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test3.617.11.55.82.611.5
Element Collection Test1.510.90.694.91.17.9
Inheritance Test3.514.31.45.92.410.1
Indexing Test5.324.42.513.73.919.1
Graph (Binary Tree) Test1.76.81.36.71.56.7
Multithreading Test7.234.22.410.24.822.2
All Tests3.817.91.67.92.712.9

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
 EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.4314.615.527.28.020.9
Element Collection Test0.160.00461.44.30.782.1
Inheritance Test0.390.01117.67.49.03.7
Indexing Test0.4317.016.635.08.526.0
Graph (Binary Tree) Test0.531.00.761.40.651.2
Multithreading Test0.1918.711.027.65.623.1
All Tests0.358.610.517.15.412.8

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
 EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test1.55.00.441.10.953.1
Element Collection Test1.41.70.431.30.921.5
Inheritance Test1.12.20.611.20.861.7
Indexing Test0.2613.80.5223.20.3918.5
Multithreading Test1.91.40.720.601.30.99
All Tests1.24.80.545.50.885.1

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
 EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.3910.01.86.01.18.0
Element Collection Test0.230.0111.43.80.831.9
Inheritance Test0.420.0462.65.01.52.5
Indexing Test0.468.93.17.01.88.0
Graph (Binary Tree) Test0.672.40.411.30.541.9
Multithreading Test0.4816.62.64.31.510.4
All Tests0.446.32.04.61.25.4

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
 EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.3518.31.711.11.014.7
Element Collection Test0.110.0120.512.90.311.4
Inheritance Test0.290.0301.66.60.943.3
Indexing Test0.4623.21.99.71.216.4
Graph (Binary Tree) Test0.541.80.492.40.512.1
Multithreading Test0.3131.23.617.31.924.2
All Tests0.3412.41.68.30.9810.4

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
 EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
EclipseLink
MySQL server
OpenJPA
H2 embedded
Basic Person Test1.313.04.210.22.711.6
Element Collection Test0.692.50.893.40.793.0
Inheritance Test1.13.34.85.22.94.3
Indexing Test1.417.54.917.73.217.6
Graph (Binary Tree) Test0.853.00.733.00.793.0
Multithreading Test2.020.44.012.03.016.2
All Tests1.210.23.38.82.39.5

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