Compare with

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

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
 OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
Basic Person Test0.42stopped5.8stopped3.1stopped
Element Collection Test0.23stopped6.5stopped3.4stopped
Inheritance Test0.29stopped4.3stopped2.3stopped
Indexing Test0.39stopped5.0stopped2.7stopped
Graph (Binary Tree) Test0.072stopped0.16stopped0.11stopped
Multithreading Test0.71stopped10.0stopped5.3stopped
All Tests0.35stopped5.3stopped2.8stopped

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
 OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
Basic Person Test0.37stopped2.1stopped1.2stopped
Element Collection Test0.23stopped0.67stopped0.45stopped
Inheritance Test0.095stopped0.80stopped0.45stopped
Indexing Test0.76stopped3.0stopped1.9stopped
Multithreading Test2.6stopped4.2stopped3.4stopped
All Tests0.81stopped2.1stopped1.5stopped

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
 OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
Basic Person Test0.81stopped2.8stopped1.8stopped
Element Collection Test0.99stopped3.6stopped2.3stopped
Inheritance Test0.51stopped3.3stopped1.9stopped
Indexing Test2.4stopped4.4stopped3.4stopped
Graph (Binary Tree) Test0.32stopped0.31stopped0.32stopped
Multithreading Test1.4stopped4.1stopped2.7stopped
All Tests1.1stopped3.1stopped2.1stopped

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
 OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
OpenJPA
Derby server
Hibernate
HSQLDB server
Basic Person Test4.5stopped9.1stopped6.8stopped
Element Collection Test3.4stopped1.9stopped2.7stopped
Inheritance Test3.8stopped4.8stopped4.3stopped
Indexing Test10.1stopped5.1stopped7.6stopped
Graph (Binary Tree) Test3.0stopped5.5stopped4.3stopped
Multithreading Test5.1stopped0.0000stopped2.5stopped
All Tests5.0stopped4.4stopped4.7stopped

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

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