Compare with

Comparison of EclipseLink with H2 embedded vs OpenJPA 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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test25.113.38.96.917.010.1
Element Collection Test20.48.68.05.314.27.0
Inheritance Test28.712.28.75.818.79.0
Indexing Test37.616.714.09.125.812.9
Graph (Binary Tree) Test17.76.114.77.316.26.7
Multithreading Test30.326.811.47.020.816.9
All Tests26.613.910.96.918.810.4

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test30.421.829.130.129.725.9
Element Collection Test19.60.006827.64.523.62.2
Inheritance Test33.80.002539.82.036.80.98
Indexing Test22.222.141.343.631.832.9
Graph (Binary Tree) Test16.02.120.02.118.02.1
Multithreading Test33.720.929.023.531.422.2
All Tests25.911.131.117.628.514.4

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test4.42.81.40.912.91.9
Element Collection Test4.11.42.40.953.21.2
Inheritance Test3.42.42.01.32.71.8
Indexing Test13.015.422.834.317.924.9
Multithreading Test1.01.40.670.530.850.95
All Tests5.24.75.97.65.56.1

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test16.612.07.65.312.18.6
Element Collection Test15.30.01710.53.712.91.8
Inheritance Test15.70.00989.82.012.70.99
Indexing Test12.19.39.95.511.07.4
Graph (Binary Tree) Test13.72.57.01.610.32.1
Multithreading Test20.920.04.23.712.611.8
All Tests15.77.38.23.612.05.5

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test35.121.319.615.727.418.5
Element Collection Test19.30.0118.52.913.91.5
Inheritance Test36.00.007014.03.525.01.8
Indexing Test42.528.819.215.230.922.0
Graph (Binary Tree) Test12.22.914.43.613.33.2
Multithreading Test54.426.025.819.640.122.8
All Tests33.313.216.910.125.111.6

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test36.241.439.241.437.741.4
Element Collection Test33.346.934.946.934.146.9
Inheritance Test35.441.436.241.435.841.4
Indexing Test39.848.443.749.241.748.8
Graph (Binary Tree) Test41.028.528.421.434.725.0
Multithreading Test48.751.912.410.330.631.1
All Tests39.143.132.535.135.839.1

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
 EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
EclipseLink
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test22.314.313.311.817.813.0
Element Collection Test15.72.011.43.513.62.7
Inheritance Test23.52.914.92.919.22.9
Indexing Test25.518.521.521.623.520.0
Graph (Binary Tree) Test14.93.414.03.714.53.5
Multithreading Test28.119.014.210.921.114.9
All Tests21.910.214.99.218.49.7

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