Compare with

Comparison of Hibernate with HSQLDB server 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 server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped15.4stopped12.9stopped14.2
Element Collection Teststopped14.1stopped8.4stopped11.3
Inheritance Teststopped8.4stopped9.7stopped9.1
Indexing Teststopped15.5stopped14.2stopped14.9
Graph (Binary Tree) Teststopped8.5stopped7.1stopped7.8
Multithreading Teststopped12.3stopped0.0000stopped6.1
All Testsstopped12.4stopped8.7stopped10.5

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (10.5) reveals that in these tests, EclipseLink with H2 embedded 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
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped18.6stopped30.2stopped24.4
Element Collection Teststopped16.3stopped21.5stopped18.9
Inheritance Teststopped19.7stopped27.1stopped23.4
Indexing Teststopped17.9stopped29.1stopped23.5
Graph (Binary Tree) Teststopped5.9stopped18.3stopped12.1
Multithreading Teststopped26.9stopped39.9stopped33.4
All Testsstopped17.6stopped27.7stopped22.6

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (22.6) reveals that in these tests, EclipseLink with H2 embedded 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
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped3.5stopped12.2stopped7.8
Element Collection Teststopped7.6stopped10.1stopped8.9
Inheritance Teststopped2.2stopped12.3stopped7.3
Indexing Teststopped11.5stopped21.6stopped16.6
Multithreading Teststopped3.2stopped12.0stopped7.6
All Testsstopped5.6stopped13.6stopped9.6

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (9.6) reveals that in these tests, EclipseLink with H2 embedded 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
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped21.0stopped9.3stopped15.1
Element Collection Teststopped26.7stopped12.3stopped19.5
Inheritance Teststopped15.6stopped14.0stopped14.8
Indexing Teststopped53.2stopped12.4stopped32.8
Graph (Binary Tree) Teststopped11.4stopped6.1stopped8.7
Multithreading Teststopped14.9stopped6.6stopped10.7
All Testsstopped23.8stopped10.1stopped17.0

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (17.0) reveals that in these tests, EclipseLink with H2 embedded 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
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped43.5stopped29.0stopped36.2
Element Collection Teststopped31.5stopped3.9stopped17.7
Inheritance Teststopped49.9stopped20.7stopped35.3
Indexing Teststopped83.8stopped15.9stopped49.9
Graph (Binary Tree) Teststopped35.3stopped39.8stopped37.6
Multithreading Teststopped28.0stopped0.0000stopped14.0
All Testsstopped45.3stopped18.2stopped31.8

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (31.8) reveals that in these tests, EclipseLink with H2 embedded 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
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Hibernate
HSQLDB server
EclipseLink
H2 embedded
Basic Person Teststopped20.4stopped18.7stopped19.6
Element Collection Teststopped19.2stopped11.2stopped15.2
Inheritance Teststopped19.2stopped16.8stopped18.0
Indexing Teststopped36.4stopped18.7stopped27.5
Graph (Binary Tree) Teststopped15.3stopped17.8stopped16.5
Multithreading Teststopped17.0stopped11.7stopped14.4
All Testsstopped21.5stopped15.7stopped18.6

The results above show that in general EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (18.6) reveals that in these tests, EclipseLink with H2 embedded 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 EclipseLink with H2 embedded database (20.4) reveals that in that case, EclipseLink with H2 embedded is ? times faster than Hibernate with HSQLDB server.

Other Head to Head DBMS/JPA Comparisons