Compare with

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

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
 Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Basic Person Teststopped2.0stopped14.8stopped8.4
Element Collection Teststopped0.34stopped7.0stopped3.7
Inheritance Teststopped1.3stopped9.9stopped5.6
Indexing Teststopped1.5stopped18.8stopped10.1
Graph (Binary Tree) Teststopped0.14stopped0.17stopped0.15
Multithreading Teststopped3.2stopped5.0stopped4.1
All Testsstopped1.4stopped9.3stopped5.3

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
 Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Basic Person Teststopped0.19stopped1.2stopped0.69
Element Collection Teststopped0.28stopped1.2stopped0.74
Inheritance Teststopped0.24stopped1.3stopped0.79
Indexing Teststopped1.1stopped4.9stopped3.0
Multithreading Teststopped1.1stopped2.5stopped1.8
All Testsstopped0.59stopped2.2stopped1.4

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
 Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Basic Person Teststopped0.18stopped0.69stopped0.43
Element Collection Teststopped0.39stopped0.99stopped0.69
Inheritance Teststopped0.20stopped0.91stopped0.55
Indexing Teststopped0.59stopped1.1stopped0.86
Graph (Binary Tree) Teststopped0.29stopped0.15stopped0.22
Multithreading Teststopped0.25stopped1.6stopped0.95
All Testsstopped0.31stopped0.92stopped0.62

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
 Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Basic Person Teststopped1.2stopped5.2stopped3.2
Element Collection Teststopped1.3stopped0.98stopped1.1
Inheritance Teststopped1.5stopped3.7stopped2.6
Indexing Teststopped2.0stopped2.8stopped2.4
Graph (Binary Tree) Teststopped2.9stopped5.0stopped3.9
Multithreading Teststopped1.1stopped0.0000stopped0.57
All Testsstopped1.7stopped3.0stopped2.3

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
 Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Hibernate
HSQLDB server
OpenJPA
MySQL server
Basic Person Teststopped1.0stopped5.3stopped3.2
Element Collection Teststopped0.79stopped2.9stopped1.8
Inheritance Teststopped0.82stopped4.2stopped2.5
Indexing Teststopped1.4stopped6.8stopped4.1
Graph (Binary Tree) Teststopped1.3stopped1.7stopped1.5
Multithreading Teststopped1.5stopped1.8stopped1.7
All Testsstopped1.1stopped3.9stopped2.5

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