Compare with

Comparison of OpenJPA with MySQL server vs EclipseLink 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
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test3.925.11.68.92.717.0
Element Collection Test1.620.40.688.01.114.2
Inheritance Test3.628.71.48.72.518.7
Indexing Test5.637.62.414.04.025.8
Graph (Binary Tree) Test0.6817.70.5714.70.6316.2
Multithreading Test7.230.32.711.44.920.8
All Tests3.726.61.510.92.618.8

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

A huge 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 embedded database (17.7) reveals that in that case, EclipseLink with H2 embedded is 26.0 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
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test3.230.422.729.112.929.7
Element Collection Test0.003819.62.927.61.423.6
Inheritance Test0.01733.86.939.83.436.8
Indexing Test2.422.223.441.312.931.8
Graph (Binary Tree) Test0.2716.00.3520.00.3118.0
Multithreading Test0.1433.718.129.09.131.4
All Tests1.025.912.431.16.728.5

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test9.34.42.21.45.82.9
Element Collection Test4.84.11.12.42.93.2
Inheritance Test1.53.40.902.01.22.7
Indexing Test0.3113.02.122.81.217.9
Multithreading Test1.91.00.990.671.40.85
All Tests3.65.21.55.92.55.5

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

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

On the other hand, EclipseLink with H2 embedded is slower, for instance, when using simple basic entities with small retrieval size. Comparing the normalized speed of EclipseLink with H2 embedded database (4.4) to the normalized speed of OpenJPA with MySQL database server (9.3) reveals that in that case, EclipseLink with H2 embedded is 2.1 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
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test0.7416.61.67.61.212.1
Element Collection Test0.01415.31.710.50.8712.9
Inheritance Test0.04815.72.09.81.012.7
Indexing Test0.7412.13.09.91.911.0
Graph (Binary Tree) Test0.4513.70.257.00.3510.3
Multithreading Test0.5520.92.94.21.712.6
All Tests0.4215.71.98.21.212.0

The results above show that in general EclipseLink with H2 embedded is much 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 embedded database (12.0) reveals that in these tests, EclipseLink with H2 embedded is 10.0 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 embedded database (15.3) reveals that in that case, EclipseLink with H2 embedded is 1,093 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
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test0.9835.11.719.61.427.4
Element Collection Test0.009919.30.658.50.3313.9
Inheritance Test0.03336.01.514.00.7525.0
Indexing Test0.6442.52.019.21.330.9
Graph (Binary Tree) Test0.4112.20.4314.40.4213.3
Multithreading Test0.2754.42.925.81.640.1
All Tests0.3933.31.516.90.9625.1

The results above show that in general EclipseLink with H2 embedded 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 embedded database (25.1) reveals that in these tests, EclipseLink with H2 embedded is 26.1 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 embedded database (19.3) reveals that in that case, EclipseLink with H2 embedded is 1,949 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
 OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
OpenJPA
MySQL server
EclipseLink
H2 embedded
Basic Person Test3.622.36.013.34.817.8
Element Collection Test1.315.71.411.41.313.6
Inheritance Test1.023.52.514.91.819.2
Indexing Test1.925.56.621.54.323.5
Graph (Binary Tree) Test0.4514.90.4014.00.4314.5
Multithreading Test2.028.15.514.23.821.1
All Tests1.821.93.914.92.818.4

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

A huge performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.40) to the normalized speed of EclipseLink with H2 embedded database (14.0) reveals that in that case, EclipseLink with H2 embedded is 35.0 times faster than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons