Compare with

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

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
 OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
Basic Person Test2.1stopped10.3stopped6.2stopped
Element Collection Test0.40stopped8.9stopped4.6stopped
Inheritance Test2.2stopped8.2stopped5.2stopped
Indexing Test1.6stopped12.4stopped7.0stopped
Graph (Binary Tree) Test0.12stopped0.18stopped0.15stopped
Multithreading Test3.7stopped6.4stopped5.0stopped
All Tests1.7stopped7.7stopped4.7stopped

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
 OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
Basic Person Testfailedstoppedfailedstoppedfailedstopped
Element Collection Testfailedstoppedfailedstoppedfailedstopped
Inheritance Testfailedstoppedfailedstoppedfailedstopped
Indexing Testfailedstoppedfailedstoppedfailedstopped
Multithreading Testfailedstoppedfailedstoppedfailedstopped
All Testsfailedstoppedfailedstoppedfailedstopped

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

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

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
 OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
Basic Person Test8.2stopped10.9stopped9.6stopped
Element Collection Test5.4stopped2.4stopped3.9stopped
Inheritance Test8.5stopped5.7stopped7.1stopped
Indexing Test14.1stopped6.2stopped10.2stopped
Graph (Binary Tree) Test4.5stopped7.5stopped6.0stopped
Multithreading Test6.8stopped0.0000stopped3.4stopped
All Tests7.9stopped5.5stopped6.7stopped

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
 OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
OpenJPA
PostgreSQL server
Hibernate
HSQLDB server
Basic Person Test4.4stopped7.9stopped6.1stopped
Element Collection Test3.5stopped5.4stopped4.5stopped
Inheritance Test4.0stopped6.3stopped5.1stopped
Indexing Test6.7stopped8.1stopped7.4stopped
Graph (Binary Tree) Test1.9stopped2.6stopped2.3stopped
Multithreading Test4.8stopped1.7stopped3.2stopped
All Tests4.2stopped5.3stopped4.8stopped

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