Compare with

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

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
 OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
Basic Person Test14.7stopped28.9stopped21.8stopped
Element Collection Test1.0stopped14.9stopped8.0stopped
Inheritance Test1.4stopped18.0stopped9.7stopped
Indexing Test20.1stopped31.4stopped25.7stopped
Graph (Binary Tree) Test0.35stopped1.5stopped0.92stopped
Multithreading Test20.1stopped26.3stopped23.2stopped
All Tests9.6stopped20.2stopped14.9stopped

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
 OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
Basic Person Test1.3stopped8.6stopped5.0stopped
Element Collection Test0.41stopped0.95stopped0.68stopped
Inheritance Test0.24stopped1.1stopped0.66stopped
Indexing Test9.1stopped17.7stopped13.4stopped
Multithreading Test5.2stopped10.6stopped7.9stopped
All Tests3.2stopped7.8stopped5.5stopped

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
 OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
Basic Person Test2.2stopped5.1stopped3.6stopped
Element Collection Test2.6stopped4.6stopped3.6stopped
Inheritance Test1.0stopped5.3stopped3.2stopped
Indexing Test7.0stopped7.5stopped7.2stopped
Graph (Binary Tree) Test1.3stopped1.0stopped1.2stopped
Multithreading Test4.9stopped5.5stopped5.2stopped
All Tests3.2stopped4.8stopped4.0stopped

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
 OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
Basic Person Test8.6stopped8.1stopped8.4stopped
Element Collection Test6.2stopped1.3stopped3.7stopped
Inheritance Test7.3stopped4.3stopped5.8stopped
Indexing Test15.2stopped6.0stopped10.6stopped
Graph (Binary Tree) Test5.6stopped8.3stopped6.9stopped
Multithreading Test5.5stopped0.0000stopped2.7stopped
All Tests8.1stopped4.7stopped6.4stopped

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
 OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
OpenJPA
Derby embedded
Hibernate
HSQLDB server
Basic Person Test6.7stopped11.4stopped9.1stopped
Element Collection Test3.5stopped5.4stopped4.5stopped
Inheritance Test2.8stopped6.9stopped4.8stopped
Indexing Test11.5stopped13.9stopped12.7stopped
Graph (Binary Tree) Test2.4stopped3.3stopped2.9stopped
Multithreading Test8.6stopped8.5stopped8.5stopped
All Tests6.0stopped8.4stopped7.2stopped

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