Compare with

Comparison of Hibernate with HSQLDB server vs Hibernate with H2 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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped8.4stopped6.7stopped7.6
Element Collection Teststopped14.6stopped8.8stopped11.7
Inheritance Teststopped5.5stopped13.4stopped9.4
Indexing Teststopped13.7stopped14.1stopped13.9
Graph (Binary Tree) Teststopped6.9stopped5.0stopped6.0
Multithreading Teststopped8.9stopped0.0000stopped4.5
All Testsstopped9.7stopped8.0stopped8.8

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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped2.2stopped2.0stopped2.1
Element Collection Teststopped0.53stopped0.45stopped0.49
Inheritance Teststopped1.4stopped6.0stopped3.7
Indexing Teststopped1.3stopped0.010stopped0.68
Graph (Binary Tree) Teststopped0.16stopped0.29stopped0.22
Multithreading Teststopped1.5stopped7.1stopped4.3
All Testsstopped1.2stopped2.6stopped1.9

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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped0.55stopped1.9stopped1.2
Element Collection Teststopped0.94stopped0.52stopped0.73
Inheritance Teststopped0.59stopped2.1stopped1.3
Indexing Teststopped0.68stopped2.0stopped1.4
Multithreading Teststopped2.2stopped2.8stopped2.5
All Testsstopped0.99stopped1.9stopped1.4

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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped1.8stopped1.7stopped1.8
Element Collection Teststopped3.8stopped0.88stopped2.3
Inheritance Teststopped3.5stopped1.9stopped2.7
Indexing Teststopped6.0stopped2.0stopped4.0
Graph (Binary Tree) Teststopped0.67stopped0.30stopped0.49
Multithreading Teststopped2.5stopped1.0stopped1.7
All Testsstopped3.0stopped1.3stopped2.2

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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped14.8stopped14.0stopped14.4
Element Collection Teststopped6.0stopped0.93stopped3.5
Inheritance Teststopped7.6stopped7.1stopped7.3
Indexing Teststopped16.2stopped5.9stopped11.1
Graph (Binary Tree) Teststopped6.2stopped8.2stopped7.2
Multithreading Teststopped5.2stopped0.0000stopped2.6
All Testsstopped9.3stopped6.0stopped7.7

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
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Hibernate
HSQLDB server
Hibernate
H2 server
Basic Person Teststopped5.5stopped5.3stopped5.4
Element Collection Teststopped5.2stopped2.3stopped3.7
Inheritance Teststopped3.7stopped6.1stopped4.9
Indexing Teststopped7.6stopped4.8stopped6.2
Graph (Binary Tree) Teststopped3.5stopped3.5stopped3.5
Multithreading Teststopped4.1stopped2.2stopped3.1
All Testsstopped5.0stopped4.0stopped4.5

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