Compare with

Comparison of OpenJPA with MySQL 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
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
Basic Person Test1.5stopped4.6stopped3.0stopped
Element Collection Test1.7stopped4.1stopped2.9stopped
Inheritance Test0.89stopped5.2stopped3.0stopped
Indexing Test1.8stopped6.3stopped4.1stopped
Graph (Binary Tree) Test1.8stopped1.6stopped1.7stopped
Multithreading Test2.1stopped0.0000stopped1.0stopped
All Tests1.6stopped3.6stopped2.6stopped

The results above show that in general OpenJPA with MySQL 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 MySQL database server (2.6) reveals that in these tests, OpenJPA with MySQL 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
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
Basic Person Test2.0stopped14.8stopped8.4stopped
Element Collection Test0.34stopped7.0stopped3.7stopped
Inheritance Test1.3stopped9.9stopped5.6stopped
Indexing Test1.5stopped18.8stopped10.1stopped
Graph (Binary Tree) Test0.14stopped0.17stopped0.15stopped
Multithreading Test3.2stopped5.0stopped4.1stopped
All Tests1.4stopped9.3stopped5.3stopped

The results above show that in general OpenJPA with MySQL 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 MySQL database server (5.3) reveals that in these tests, OpenJPA with MySQL 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
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
Basic Person Test0.19stopped1.2stopped0.69stopped
Element Collection Test0.28stopped1.2stopped0.74stopped
Inheritance Test0.24stopped1.3stopped0.79stopped
Indexing Test1.1stopped4.9stopped3.0stopped
Multithreading Test1.1stopped2.5stopped1.8stopped
All Tests0.59stopped2.2stopped1.4stopped

The results above show that in general OpenJPA with MySQL 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 MySQL database server (1.4) reveals that in these tests, OpenJPA with MySQL 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
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
Basic Person Test0.18stopped0.69stopped0.43stopped
Element Collection Test0.39stopped0.99stopped0.69stopped
Inheritance Test0.20stopped0.91stopped0.55stopped
Indexing Test0.59stopped1.1stopped0.86stopped
Graph (Binary Tree) Test0.29stopped0.15stopped0.22stopped
Multithreading Test0.25stopped1.6stopped0.95stopped
All Tests0.31stopped0.92stopped0.62stopped

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

The results above show that in general OpenJPA with MySQL 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 MySQL database server (2.3) reveals that in these tests, OpenJPA with MySQL 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
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
Basic Person Test1.0stopped5.3stopped3.2stopped
Element Collection Test0.79stopped2.9stopped1.8stopped
Inheritance Test0.82stopped4.2stopped2.5stopped
Indexing Test1.4stopped6.8stopped4.1stopped
Graph (Binary Tree) Test1.3stopped1.7stopped1.5stopped
Multithreading Test1.5stopped1.8stopped1.7stopped
All Tests1.1stopped3.9stopped2.5stopped

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

Other Head to Head DBMS/JPA Comparisons