Compare with

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

The results above show that in general OpenJPA with H2 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 H2 database server (5.7) reveals that in these tests, OpenJPA with H2 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
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
Basic Person Test1.7stopped6.1stopped3.9stopped
Element Collection Test0.32stopped6.9stopped3.6stopped
Inheritance Test0.82stopped4.8stopped2.8stopped
Indexing Test1.1stopped9.7stopped5.4stopped
Graph (Binary Tree) Test0.11stopped0.15stopped0.13stopped
Multithreading Test2.2stopped9.6stopped5.9stopped
All Tests1.1stopped6.2stopped3.6stopped

The results above show that in general OpenJPA with H2 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 H2 database server (3.6) reveals that in these tests, OpenJPA with H2 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
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
Basic Person Test0.54stopped2.2stopped1.4stopped
Element Collection Test0.53stopped2.0stopped1.3stopped
Inheritance Test0.42stopped2.1stopped1.2stopped
Indexing Test0.78stopped2.6stopped1.7stopped
Multithreading Test2.9stopped4.3stopped3.6stopped
All Tests1.0stopped2.6stopped1.8stopped

The results above show that in general OpenJPA with H2 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 H2 database server (1.8) reveals that in these tests, OpenJPA with H2 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
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
Basic Person Test1.1stopped2.1stopped1.6stopped
Element Collection Test1.2stopped3.6stopped2.4stopped
Inheritance Test1.2stopped2.5stopped1.8stopped
Indexing Test3.3stopped2.9stopped3.1stopped
Graph (Binary Tree) Test0.61stopped0.34stopped0.48stopped
Multithreading Test2.7stopped0.76stopped1.8stopped
All Tests1.7stopped2.0stopped1.9stopped

The results above show that in general OpenJPA with H2 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 H2 database server (1.9) reveals that in these tests, OpenJPA with H2 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
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
Basic Person Test6.9stopped11.6stopped9.3stopped
Element Collection Test3.5stopped2.2stopped2.9stopped
Inheritance Test8.0stopped5.4stopped6.7stopped
Indexing Test12.2stopped5.8stopped9.0stopped
Graph (Binary Tree) Test7.4stopped10.0stopped8.7stopped
Multithreading Test8.3stopped0.0000stopped4.1stopped
All Tests7.7stopped5.8stopped6.8stopped

The results above show that in general OpenJPA with H2 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 H2 database server (6.8) reveals that in these tests, OpenJPA with H2 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
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
OpenJPA
H2 server
Hibernate
HSQLDB server
Basic Person Test3.7stopped5.7stopped4.7stopped
Element Collection Test2.4stopped4.3stopped3.4stopped
Inheritance Test3.0stopped4.4stopped3.7stopped
Indexing Test4.9stopped6.1stopped5.5stopped
Graph (Binary Tree) Test2.7stopped3.2stopped2.9stopped
Multithreading Test4.8stopped2.9stopped3.9stopped
All Tests3.6stopped4.5stopped4.0stopped

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

Other Head to Head DBMS/JPA Comparisons