Compare with

Comparison of OpenJPA with HSQLDB embedded 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
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test13.325.16.98.910.117.0
Element Collection Test8.620.45.38.07.014.2
Inheritance Test12.228.75.88.79.018.7
Indexing Test16.737.69.114.012.925.8
Graph (Binary Tree) Test6.117.77.314.76.716.2
Multithreading Test26.830.37.011.416.920.8
All Tests13.926.66.910.910.418.8

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (6.1) to the normalized speed of EclipseLink with H2 embedded database (17.7) reveals that in that case, EclipseLink with H2 embedded is 2.9 times faster than OpenJPA with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test21.830.430.129.125.929.7
Element Collection Test0.006819.64.527.62.223.6
Inheritance Test0.002533.82.039.80.9836.8
Indexing Test22.122.243.641.332.931.8
Graph (Binary Tree) Test2.116.02.120.02.118.0
Multithreading Test20.933.723.529.022.231.4
All Tests11.125.917.631.114.428.5

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

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0025) to the normalized speed of EclipseLink with H2 embedded database (33.8) reveals that in that case, EclipseLink with H2 embedded is 13,520 times faster than OpenJPA with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test2.84.40.911.41.92.9
Element Collection Test1.44.10.952.41.23.2
Inheritance Test2.43.41.32.01.82.7
Indexing Test15.413.034.322.824.917.9
Multithreading Test1.41.00.530.670.950.85
All Tests4.75.27.65.96.15.5

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

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of EclipseLink with H2 embedded database (4.1) reveals that in that case, OpenJPA with HSQLDB embedded is 2.9 times slower than EclipseLink with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test12.016.65.37.68.612.1
Element Collection Test0.01715.33.710.51.812.9
Inheritance Test0.009815.72.09.80.9912.7
Indexing Test9.312.15.59.97.411.0
Graph (Binary Tree) Test2.513.71.67.02.110.3
Multithreading Test20.020.93.74.211.812.6
All Tests7.315.73.68.25.512.0

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of EclipseLink with H2 embedded database (15.7) reveals that in that case, EclipseLink with H2 embedded is 1,602 times faster than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test21.335.115.719.618.527.4
Element Collection Test0.01119.32.98.51.513.9
Inheritance Test0.007036.03.514.01.825.0
Indexing Test28.842.515.219.222.030.9
Graph (Binary Tree) Test2.912.23.614.43.213.3
Multithreading Test26.054.419.625.822.840.1
All Tests13.233.310.116.911.625.1

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0070) to the normalized speed of EclipseLink with H2 embedded database (36.0) reveals that in that case, EclipseLink with H2 embedded is 5,143 times faster than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test41.436.241.439.241.437.7
Element Collection Test46.933.346.934.946.934.1
Inheritance Test41.435.441.436.241.435.8
Indexing Test48.439.849.243.748.841.7
Graph (Binary Tree) Test28.541.021.428.425.034.7
Multithreading Test51.948.710.312.431.130.6
All Tests43.139.135.132.539.135.8

The results above show that in general OpenJPA with HSQLDB embedded is slightly more efficient than EclipseLink 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
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test14.322.311.813.313.017.8
Element Collection Test2.015.73.511.42.713.6
Inheritance Test2.923.52.914.92.919.2
Indexing Test18.525.521.621.520.023.5
Graph (Binary Tree) Test3.414.93.714.03.514.5
Multithreading Test19.028.110.914.214.921.1
All Tests10.221.99.214.99.718.4

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

Other Head to Head DBMS/JPA Comparisons