Compare with

Comparison of Hibernate with H2 server 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
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test4.627.13.017.23.822.2
Element Collection Test3.717.21.18.22.412.7
Inheritance Test6.726.73.111.94.919.3
Indexing Test8.230.64.218.66.224.6
Graph (Binary Tree) Test3.420.03.915.93.718.0
Multithreading Test6.832.55.011.45.922.0
All Tests5.625.73.413.94.519.8

The results above show that in general EclipseLink with HSQLDB embedded is much more efficient than Hibernate with H2 server in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with H2 database server (4.5) to the normalized speed of EclipseLink with HSQLDB embedded database (19.8) reveals that in these tests, EclipseLink with HSQLDB embedded is 4.4 times faster than Hibernate with H2 server.

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with H2 database server (1.1) to the normalized speed of EclipseLink with HSQLDB embedded database (8.2) reveals that in that case, EclipseLink with HSQLDB embedded is 7.5 times faster than Hibernate with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test3.124.46.036.04.630.2
Element Collection Test1.014.91.119.11.017.0
Inheritance Test2.922.87.640.05.231.4
Indexing Test2.620.77.038.74.829.7
Graph (Binary Tree) Test0.428.71.114.20.7811.4
Multithreading Test6.524.210.528.08.526.1
All Tests2.819.35.629.34.224.3

The results above show that in general EclipseLink with HSQLDB embedded is much more efficient than Hibernate with H2 server in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with H2 database server (4.2) to the normalized speed of EclipseLink with HSQLDB embedded database (24.3) reveals that in these tests, EclipseLink with HSQLDB embedded is 5.8 times faster than Hibernate with H2 server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test3.72.91.00.882.31.9
Element Collection Test3.73.20.631.42.22.3
Inheritance Test3.22.61.41.12.31.9
Indexing Test1.721.55.833.33.827.4
Multithreading Test1.11.10.880.521.00.82
All Tests2.76.31.97.42.36.9

The results above show that in general EclipseLink with HSQLDB embedded is much more efficient than Hibernate with H2 server in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 database server (2.3) to the normalized speed of EclipseLink with HSQLDB embedded database (6.9) reveals that in these tests, EclipseLink with HSQLDB embedded is 3.0 times faster than Hibernate with H2 server.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.7) to the normalized speed of EclipseLink with HSQLDB embedded database (21.5) reveals that in that case, EclipseLink with HSQLDB embedded is 12.6 times faster than Hibernate with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test2.917.91.87.02.412.5
Element Collection Test2.614.61.18.31.911.4
Inheritance Test3.216.22.59.72.913.0
Indexing Test2.912.02.76.82.89.4
Graph (Binary Tree) Test1.24.70.433.40.794.0
Multithreading Test5.624.42.44.44.014.4
All Tests3.115.01.86.62.510.8

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test3.832.32.420.33.126.3
Element Collection Test1.914.31.16.01.510.2
Inheritance Test3.729.22.523.93.126.6
Indexing Test7.655.33.127.15.341.2
Graph (Binary Tree) Test0.996.80.9114.10.9510.4
Multithreading Test6.152.97.328.46.740.6
All Tests4.031.82.920.03.525.9

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Hibernate
H2 server
EclipseLink
HSQLDB embedded
Basic Person Test3.620.92.816.33.218.6
Element Collection Test2.612.81.08.61.810.7
Inheritance Test4.019.53.417.33.718.4
Indexing Test4.628.04.524.94.626.5
Graph (Binary Tree) Test1.510.01.611.91.611.0
Multithreading Test5.227.05.214.65.220.8
All Tests3.720.13.215.73.417.9

The results above show that in general EclipseLink with HSQLDB embedded is much more efficient than Hibernate with H2 server in performing JPA database operations. Comparing the normalized speed of Hibernate with H2 database server (3.4) to the normalized speed of EclipseLink with HSQLDB embedded database (17.9) reveals that in these tests, EclipseLink with HSQLDB embedded is 5.3 times faster than Hibernate with H2 server.

A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.0) to the normalized speed of EclipseLink with HSQLDB embedded database (8.6) reveals that in that case, EclipseLink with HSQLDB embedded is 8.6 times faster than Hibernate with H2 server.

Other Head to Head DBMS/JPA Comparisons