Compare with

Comparison of OpenJPA with H2 server 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 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test3.73.62.21.52.92.6
Element Collection Test2.61.51.50.692.11.1
Inheritance Test4.53.52.01.43.22.4
Indexing Test7.35.33.62.55.43.9
Graph (Binary Tree) Test1.11.70.841.30.971.5
Multithreading Test7.77.24.22.45.94.8
All Tests4.53.82.41.63.42.7

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (0.69) to the normalized speed of OpenJPA with H2 database server (1.5) reveals that in that case, OpenJPA with H2 server is 2.2 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 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test2.90.437.615.55.28.0
Element Collection Test0.00220.161.91.40.930.78
Inheritance Test0.0130.394.017.62.09.0
Indexing Test4.10.438.816.66.58.5
Graph (Binary Tree) Test0.380.530.490.760.440.65
Multithreading Test5.90.1914.011.010.05.6
All Tests2.20.356.110.54.25.4

The results above show that in general EclipseLink with MySQL server is slightly more efficient than OpenJPA with H2 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 H2 database server (0.0022) to the normalized speed of EclipseLink with MySQL database server (0.16) reveals that in that case, EclipseLink with MySQL server is 72.7 times faster than OpenJPA with H2 server.

On the other hand, EclipseLink with MySQL server is slower, for instance, 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 database server (5.9) reveals that in that case, EclipseLink with MySQL server is 31.1 times slower than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test3.71.51.00.442.40.95
Element Collection Test2.01.41.20.431.60.92
Inheritance Test2.81.11.10.612.00.86
Indexing Test3.80.267.50.525.70.39
Multithreading Test0.981.91.00.721.01.3
All Tests2.71.22.40.542.50.88

The results above show that in general OpenJPA with H2 server is 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 database server (2.5) reveals that in these tests, OpenJPA with H2 server is 2.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 database server (3.8) reveals that in that case, OpenJPA with H2 server is 14.6 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 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test3.00.392.01.82.51.1
Element Collection Test0.00780.231.91.40.940.83
Inheritance Test0.0340.422.82.61.41.5
Indexing Test2.80.463.23.13.01.8
Graph (Binary Tree) Test0.790.670.430.410.610.54
Multithreading Test7.00.482.52.64.81.5
All Tests2.30.442.12.02.21.2

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

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 database server (7.0) reveals that in that case, OpenJPA with H2 server is 14.6 times faster than EclipseLink with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0078) to the normalized speed of EclipseLink with MySQL database server (0.23) reveals that in that case, OpenJPA with H2 server is 29.5 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 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test3.20.352.21.72.71.0
Element Collection Test0.00600.110.880.510.440.31
Inheritance Test0.0300.293.11.61.60.94
Indexing Test6.50.463.61.95.11.2
Graph (Binary Tree) Test0.730.540.750.490.740.51
Multithreading Test7.60.315.23.66.41.9
All Tests3.00.342.61.62.80.98

The results above show that in general OpenJPA with H2 server is 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 database server (2.8) reveals that in these tests, OpenJPA with H2 server is 2.9 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 database server (7.6) reveals that in that case, OpenJPA with H2 server is 24.5 times faster than EclipseLink with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0060) to the normalized speed of EclipseLink with MySQL database server (0.11) reveals that in that case, OpenJPA with H2 server is 18.3 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 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
Basic Person Test3.31.33.04.23.12.7
Element Collection Test0.930.691.50.891.20.79
Inheritance Test1.51.12.64.82.02.9
Indexing Test4.91.45.44.95.13.2
Graph (Binary Tree) Test0.750.850.630.730.690.79
Multithreading Test5.92.05.44.05.63.0
All Tests2.91.23.23.33.02.3

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

A large 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 database server (4.9) reveals that in that case, OpenJPA with H2 server is 3.5 times faster than EclipseLink with MySQL server.

Other Head to Head DBMS/JPA Comparisons