Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink with HSQLDB 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
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test17.127.15.817.211.522.2
Element Collection Test10.917.24.98.27.912.7
Inheritance Test14.326.75.911.910.119.3
Indexing Test24.430.613.718.619.124.6
Graph (Binary Tree) Test6.820.06.715.96.718.0
Multithreading Test34.232.510.211.422.222.0
All Tests17.925.77.913.912.919.8

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

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (5.8) to the normalized speed of EclipseLink with HSQLDB embedded database (17.2) reveals that in that case, EclipseLink with HSQLDB embedded is 3.0 times faster than OpenJPA with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test14.624.427.236.020.930.2
Element Collection Test0.004614.94.319.12.117.0
Inheritance Test0.01122.87.440.03.731.4
Indexing Test17.020.735.038.726.029.7
Graph (Binary Tree) Test1.08.71.414.21.211.4
Multithreading Test18.724.227.628.023.126.1
All Tests8.619.317.129.312.824.3

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded 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 embedded database (0.0046) to the normalized speed of EclipseLink with HSQLDB embedded database (14.9) reveals that in that case, EclipseLink with HSQLDB embedded is 3,239 times faster than OpenJPA with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test5.02.91.10.883.11.9
Element Collection Test1.73.21.31.41.52.3
Inheritance Test2.22.61.21.11.71.9
Indexing Test13.821.523.233.318.527.4
Multithreading Test1.41.10.600.520.990.82
All Tests4.86.35.57.45.16.9

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded in executing the tested JPA queries.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test10.017.96.07.08.012.5
Element Collection Test0.01114.63.88.31.911.4
Inheritance Test0.04616.25.09.72.513.0
Indexing Test8.912.07.06.88.09.4
Graph (Binary Tree) Test2.44.71.33.41.94.0
Multithreading Test16.624.44.34.410.414.4
All Tests6.315.04.66.65.410.8

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

A huge performance gap has been detected 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 HSQLDB embedded database (14.6) reveals that in that case, EclipseLink with HSQLDB embedded is 1,327 times faster than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test18.332.311.120.314.726.3
Element Collection Test0.01214.32.96.01.410.2
Inheritance Test0.03029.26.623.93.326.6
Indexing Test23.255.39.727.116.441.2
Graph (Binary Tree) Test1.86.82.414.12.110.4
Multithreading Test31.252.917.328.424.240.6
All Tests12.431.88.320.010.425.9

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.012) to the normalized speed of EclipseLink with HSQLDB embedded database (14.3) reveals that in that case, EclipseLink with HSQLDB embedded is 1,192 times faster than OpenJPA with H2 embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test27.041.427.041.427.041.4
Element Collection Test30.646.930.646.930.646.9
Inheritance Test27.041.427.041.427.041.4
Indexing Test31.648.432.149.231.948.8
Graph (Binary Tree) Test28.528.521.421.424.925.0
Multithreading Test33.951.99.210.321.531.1
All Tests29.843.124.535.127.239.1

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded in using disk space.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
Basic Person Test13.020.910.216.311.618.6
Element Collection Test2.512.83.48.63.010.7
Inheritance Test3.319.55.217.34.318.4
Indexing Test17.528.017.724.917.626.5
Graph (Binary Tree) Test3.010.03.011.93.011.0
Multithreading Test20.427.012.014.616.220.8
All Tests10.220.18.815.79.517.9

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

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (3.3) to the normalized speed of EclipseLink with HSQLDB embedded database (19.5) reveals that in that case, EclipseLink with HSQLDB embedded is 5.9 times faster than OpenJPA with H2 embedded.

Other Head to Head DBMS/JPA Comparisons