Compare with

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

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (5.6) reveals that in these tests, OpenJPA with PostgreSQL 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
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Basic Person Teststopped2.1stopped10.3stopped6.2
Element Collection Teststopped0.40stopped8.9stopped4.6
Inheritance Teststopped2.2stopped8.2stopped5.2
Indexing Teststopped1.6stopped12.4stopped7.0
Graph (Binary Tree) Teststopped0.12stopped0.18stopped0.15
Multithreading Teststopped3.7stopped6.4stopped5.0
All Testsstopped1.7stopped7.7stopped4.7

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (4.7) reveals that in these tests, OpenJPA with PostgreSQL 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
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Basic Person Teststoppedfailedstoppedfailedstoppedfailed
Element Collection Teststoppedfailedstoppedfailedstoppedfailed
Inheritance Teststoppedfailedstoppedfailedstoppedfailed
Indexing Teststoppedfailedstoppedfailedstoppedfailed
Multithreading Teststoppedfailedstoppedfailedstoppedfailed
All Testsstoppedfailedstoppedfailedstoppedfailed

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Basic Person Teststopped1.2stopped3.4stopped2.3
Element Collection Teststopped1.5stopped3.8stopped2.6
Inheritance Teststopped1.2stopped3.8stopped2.5
Indexing Teststopped3.9stopped4.6stopped4.3
Graph (Binary Tree) Teststopped0.45stopped0.28stopped0.36
Multithreading Teststopped0.92stopped0.34stopped0.63
All Testsstopped1.5stopped2.7stopped2.1

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (2.1) reveals that in these tests, OpenJPA with PostgreSQL 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
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Basic Person Teststopped8.2stopped10.9stopped9.6
Element Collection Teststopped5.4stopped2.4stopped3.9
Inheritance Teststopped8.5stopped5.7stopped7.1
Indexing Teststopped14.1stopped6.2stopped10.2
Graph (Binary Tree) Teststopped4.5stopped7.5stopped6.0
Multithreading Teststopped6.8stopped0.0000stopped3.4
All Testsstopped7.9stopped5.5stopped6.7

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

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

Other Head to Head DBMS/JPA Comparisons