Compare with

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

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby database server (5.1) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Basic Person Teststopped0.42stopped5.8stopped3.1
Element Collection Teststopped0.23stopped6.5stopped3.4
Inheritance Teststopped0.29stopped4.3stopped2.3
Indexing Teststopped0.39stopped5.0stopped2.7
Graph (Binary Tree) Teststopped0.072stopped0.16stopped0.11
Multithreading Teststopped0.71stopped10.0stopped5.3
All Testsstopped0.35stopped5.3stopped2.8

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby database server (2.8) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Basic Person Teststopped0.37stopped2.1stopped1.2
Element Collection Teststopped0.23stopped0.67stopped0.45
Inheritance Teststopped0.095stopped0.80stopped0.45
Indexing Teststopped0.76stopped3.0stopped1.9
Multithreading Teststopped2.6stopped4.2stopped3.4
All Testsstopped0.81stopped2.1stopped1.5

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby database server (1.5) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Basic Person Teststopped0.81stopped2.8stopped1.8
Element Collection Teststopped0.99stopped3.6stopped2.3
Inheritance Teststopped0.51stopped3.3stopped1.9
Indexing Teststopped2.4stopped4.4stopped3.4
Graph (Binary Tree) Teststopped0.32stopped0.31stopped0.32
Multithreading Teststopped1.4stopped4.1stopped2.7
All Testsstopped1.1stopped3.1stopped2.1

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby database server (2.1) reveals that in these tests, OpenJPA with Derby 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
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Basic Person Teststopped4.5stopped9.1stopped6.8
Element Collection Teststopped3.4stopped1.9stopped2.7
Inheritance Teststopped3.8stopped4.8stopped4.3
Indexing Teststopped10.1stopped5.1stopped7.6
Graph (Binary Tree) Teststopped3.0stopped5.5stopped4.3
Multithreading Teststopped5.1stopped0.0000stopped2.5
All Testsstopped5.0stopped4.4stopped4.7

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

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

Other Head to Head DBMS/JPA Comparisons