Compare with

Comparison of Hibernate 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
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test32.625.113.18.922.917.0
Element Collection Test15.120.48.28.011.714.2
Inheritance Test25.528.713.68.719.518.7
Indexing Test29.637.618.814.024.225.8
Graph (Binary Tree) Test13.817.715.614.714.716.2
Multithreading Test37.430.313.011.425.220.8
All Tests25.626.613.710.919.718.8

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test24.830.416.429.120.629.7
Element Collection Test11.319.610.827.611.023.6
Inheritance Test21.733.821.039.821.336.8
Indexing Test11.922.221.541.316.731.8
Graph (Binary Tree) Test3.616.04.720.04.118.0
Multithreading Test19.833.721.529.020.631.4
All Tests15.525.916.031.115.728.5

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

A large performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (3.6) to the normalized speed of EclipseLink with H2 embedded database (16.0) reveals that in that case, EclipseLink with H2 embedded is 4.4 times faster than Hibernate with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test3.64.40.881.42.22.9
Element Collection Test3.44.11.72.42.63.2
Inheritance Test2.93.41.02.01.92.7
Indexing Test9.913.021.722.815.817.9
Multithreading Test1.11.00.580.670.820.85
All Tests4.25.25.25.94.75.5

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

A large performance gap has been detected when using class inheritance in the object model with large retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (1.0) to the normalized speed of EclipseLink with H2 embedded database (2.0) reveals that in that case, EclipseLink with H2 embedded is 2.0 times faster than Hibernate with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test14.216.65.07.69.612.1
Element Collection Test10.115.35.610.57.812.9
Inheritance Test13.415.77.59.810.512.7
Indexing Test10.712.16.19.98.411.0
Graph (Binary Tree) Test3.713.72.57.03.110.3
Multithreading Test23.920.93.84.213.912.6
All Tests12.715.75.18.28.912.0

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test26.135.117.519.621.827.4
Element Collection Test9.119.35.28.57.113.9
Inheritance Test21.436.017.714.019.625.0
Indexing Test33.042.516.319.224.730.9
Graph (Binary Tree) Test5.412.28.214.46.813.3
Multithreading Test38.554.428.625.833.540.1
All Tests22.333.315.616.918.925.1

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
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 Hibernate 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
 Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Hibernate
HSQLDB embedded
EclipseLink
H2 embedded
Basic Person Test20.222.310.613.315.417.8
Element Collection Test9.815.76.311.48.013.6
Inheritance Test17.023.512.214.914.619.2
Indexing Test19.025.516.921.518.023.5
Graph (Binary Tree) Test6.614.97.814.07.214.5
Multithreading Test24.128.113.514.218.821.1
All Tests16.521.911.314.913.918.4

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

A large performance gap has been detected when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (6.6) to the normalized speed of EclipseLink with H2 embedded database (14.9) reveals that in that case, EclipseLink with H2 embedded is 2.3 times faster than Hibernate with HSQLDB embedded.

Other Head to Head DBMS/JPA Comparisons