Compare with

Comparison of EclipseLink with MySQL server vs OpenJPA 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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test3.63.71.52.22.62.9
Element Collection Test1.52.60.691.51.12.1
Inheritance Test3.54.51.42.02.43.2
Indexing Test5.37.32.53.63.95.4
Graph (Binary Tree) Test1.71.11.30.841.50.97
Multithreading Test7.27.72.44.24.85.9
All Tests3.84.51.62.42.73.4

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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test0.432.915.57.68.05.2
Element Collection Test0.160.00221.41.90.780.93
Inheritance Test0.390.01317.64.09.02.0
Indexing Test0.434.116.68.88.56.5
Graph (Binary Tree) Test0.530.380.760.490.650.44
Multithreading Test0.195.911.014.05.610.0
All Tests0.352.210.56.15.44.2

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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test1.53.70.441.00.952.4
Element Collection Test1.42.00.431.20.921.6
Inheritance Test1.12.80.611.10.862.0
Indexing Test0.263.80.527.50.395.7
Multithreading Test1.90.980.721.01.31.0
All Tests1.22.70.542.40.882.5

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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test0.393.01.82.01.12.5
Element Collection Test0.230.00781.41.90.830.94
Inheritance Test0.420.0342.62.81.51.4
Indexing Test0.462.83.13.21.83.0
Graph (Binary Tree) Test0.670.790.410.430.540.61
Multithreading Test0.487.02.62.51.54.8
All Tests0.442.32.02.11.22.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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test0.353.21.72.21.02.7
Element Collection Test0.110.00600.510.880.310.44
Inheritance Test0.290.0301.63.10.941.6
Indexing Test0.466.51.93.61.25.1
Graph (Binary Tree) Test0.540.730.490.750.510.74
Multithreading Test0.317.63.65.21.96.4
All Tests0.343.01.62.60.982.8

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
 EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
EclipseLink
MySQL server
OpenJPA
H2 server
Basic Person Test1.33.34.23.02.73.1
Element Collection Test0.690.930.891.50.791.2
Inheritance Test1.11.54.82.62.92.0
Indexing Test1.44.94.95.43.25.1
Graph (Binary Tree) Test0.850.750.730.630.790.69
Multithreading Test2.05.94.05.43.05.6
All Tests1.22.93.33.22.33.0

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