Compare with

Comparison of Hibernate with HSQLDB server vs OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped6.6stopped6.4stopped6.5
Element Collection Teststopped7.1stopped5.5stopped6.3
Inheritance Teststopped4.1stopped5.6stopped4.9
Indexing Teststopped6.3stopped6.8stopped6.5
Graph (Binary Tree) Teststopped2.3stopped2.5stopped2.4
Multithreading Teststopped7.2stopped0.0000stopped3.6
All Testsstopped5.6stopped4.5stopped5.0

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby embedded database (5.0) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped14.7stopped28.9stopped21.8
Element Collection Teststopped1.0stopped14.9stopped8.0
Inheritance Teststopped1.4stopped18.0stopped9.7
Indexing Teststopped20.1stopped31.4stopped25.7
Graph (Binary Tree) Teststopped0.35stopped1.5stopped0.92
Multithreading Teststopped20.1stopped26.3stopped23.2
All Testsstopped9.6stopped20.2stopped14.9

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby embedded database (14.9) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped1.3stopped8.6stopped5.0
Element Collection Teststopped0.41stopped0.95stopped0.68
Inheritance Teststopped0.24stopped1.1stopped0.66
Indexing Teststopped9.1stopped17.7stopped13.4
Multithreading Teststopped5.2stopped10.6stopped7.9
All Testsstopped3.2stopped7.8stopped5.5

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby embedded database (5.5) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped2.2stopped5.1stopped3.6
Element Collection Teststopped2.6stopped4.6stopped3.6
Inheritance Teststopped1.0stopped5.3stopped3.2
Indexing Teststopped7.0stopped7.5stopped7.2
Graph (Binary Tree) Teststopped1.3stopped1.0stopped1.2
Multithreading Teststopped4.9stopped5.5stopped5.2
All Testsstopped3.2stopped4.8stopped4.0

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby embedded database (4.0) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped8.6stopped8.1stopped8.4
Element Collection Teststopped6.2stopped1.3stopped3.7
Inheritance Teststopped7.3stopped4.3stopped5.8
Indexing Teststopped15.2stopped6.0stopped10.6
Graph (Binary Tree) Teststopped5.6stopped8.3stopped6.9
Multithreading Teststopped5.5stopped0.0000stopped2.7
All Testsstopped8.1stopped4.7stopped6.4

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby embedded database (6.4) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Basic Person Teststopped6.7stopped11.4stopped9.1
Element Collection Teststopped3.5stopped5.4stopped4.5
Inheritance Teststopped2.8stopped6.9stopped4.8
Indexing Teststopped11.5stopped13.9stopped12.7
Graph (Binary Tree) Teststopped2.4stopped3.3stopped2.9
Multithreading Teststopped8.6stopped8.5stopped8.5
All Testsstopped6.0stopped8.4stopped7.2

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

Other Head to Head DBMS/JPA Comparisons