Compare with

Comparison of Hibernate with H2 server vs Hibernate with HSQLDB server

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
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test8.4stopped6.7stopped7.6stopped
Element Collection Test14.6stopped8.8stopped11.7stopped
Inheritance Test5.5stopped13.4stopped9.4stopped
Indexing Test13.7stopped14.1stopped13.9stopped
Graph (Binary Tree) Test6.9stopped5.0stopped6.0stopped
Multithreading Test8.9stopped0.0000stopped4.5stopped
All Tests9.7stopped8.0stopped8.8stopped

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test2.2stopped2.0stopped2.1stopped
Element Collection Test0.53stopped0.45stopped0.49stopped
Inheritance Test1.4stopped6.0stopped3.7stopped
Indexing Test1.3stopped0.010stopped0.68stopped
Graph (Binary Tree) Test0.16stopped0.29stopped0.22stopped
Multithreading Test1.5stopped7.1stopped4.3stopped
All Tests1.2stopped2.6stopped1.9stopped

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test0.55stopped1.9stopped1.2stopped
Element Collection Test0.94stopped0.52stopped0.73stopped
Inheritance Test0.59stopped2.1stopped1.3stopped
Indexing Test0.68stopped2.0stopped1.4stopped
Multithreading Test2.2stopped2.8stopped2.5stopped
All Tests0.99stopped1.9stopped1.4stopped

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test1.8stopped1.7stopped1.8stopped
Element Collection Test3.8stopped0.88stopped2.3stopped
Inheritance Test3.5stopped1.9stopped2.7stopped
Indexing Test6.0stopped2.0stopped4.0stopped
Graph (Binary Tree) Test0.67stopped0.30stopped0.49stopped
Multithreading Test2.5stopped1.0stopped1.7stopped
All Tests3.0stopped1.3stopped2.2stopped

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test14.8stopped14.0stopped14.4stopped
Element Collection Test6.0stopped0.93stopped3.5stopped
Inheritance Test7.6stopped7.1stopped7.3stopped
Indexing Test16.2stopped5.9stopped11.1stopped
Graph (Binary Tree) Test6.2stopped8.2stopped7.2stopped
Multithreading Test5.2stopped0.0000stopped2.6stopped
All Tests9.3stopped6.0stopped7.7stopped

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Basic Person Test5.5stopped5.3stopped5.4stopped
Element Collection Test5.2stopped2.3stopped3.7stopped
Inheritance Test3.7stopped6.1stopped4.9stopped
Indexing Test7.6stopped4.8stopped6.2stopped
Graph (Binary Tree) Test3.5stopped3.5stopped3.5stopped
Multithreading Test4.1stopped2.2stopped3.1stopped
All Tests5.0stopped4.0stopped4.5stopped

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

A huge performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of Hibernate with HSQLDB database server (0.0000) to the normalized speed of Hibernate with H2 database server (5.5) reveals that in that case, Hibernate with H2 server is ? times faster than Hibernate with HSQLDB server.

Other Head to Head DBMS/JPA Comparisons