Compare with

Comparison of OpenJPA with MySQL server vs Hibernate with SQLite embedded

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
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.90.0831.61.02.70.55
Element Collection Test1.60.0670.680.691.10.38
Inheritance Test3.60.0801.40.992.50.54
Indexing Test5.60.0982.41.04.00.55
Graph (Binary Tree) Test0.680.270.570.960.630.61
Multithreading Test7.2failed2.7failed4.9failed
All Tests3.70.121.50.932.60.53

Hibernate with SQLite embedded has failed in 2 tests (see exceptions).

The results above show that in general OpenJPA with MySQL server is much more efficient than Hibernate with SQLite embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of OpenJPA with MySQL database server (2.6) reveals that in these tests, OpenJPA with MySQL server is 4.9 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.098) to the normalized speed of OpenJPA with MySQL database server (5.6) reveals that in that case, OpenJPA with MySQL server is 57.1 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.21.822.71.312.91.5
Element Collection Test0.00380.00082.9failed1.40.0008
Inheritance Test0.0172.46.91.43.41.9
Indexing Test2.41.923.42.312.92.1
Graph (Binary Tree) Test0.270.560.350.880.310.72
Multithreading Test0.14failed18.1failed9.1failed
All Tests1.01.312.41.56.71.4

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with MySQL server is much more efficient than Hibernate with SQLite embedded in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (1.4) to the normalized speed of OpenJPA with MySQL database server (6.7) reveals that in these tests, OpenJPA with MySQL server is 4.8 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using simple basic entities with large retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (1.3) to the normalized speed of OpenJPA with MySQL database server (22.7) reveals that in that case, OpenJPA with MySQL server is 17.5 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with MySQL server is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.017) to the normalized speed of Hibernate with SQLite embedded database (2.4) reveals that in that case, OpenJPA with MySQL server is 141 times slower than Hibernate with SQLite embedded.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test9.31.12.20.225.80.65
Element Collection Test4.80.391.1failed2.90.39
Inheritance Test1.50.530.900.281.20.40
Indexing Test0.310.00112.10.431.20.21
Multithreading Test1.9failed0.99failed1.4failed
All Tests3.60.501.50.312.50.42

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with MySQL server is much more efficient than Hibernate with SQLite embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with MySQL database server (2.5) reveals that in these tests, OpenJPA with MySQL server is 6.0 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0011) to the normalized speed of OpenJPA with MySQL database server (0.31) reveals that in that case, OpenJPA with MySQL server is 282 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test0.740.0761.60.651.20.37
Element Collection Test0.0140.00221.7failed0.870.0022
Inheritance Test0.0480.0792.00.971.00.53
Indexing Test0.740.0573.00.541.90.30
Graph (Binary Tree) Test0.450.260.250.420.350.34
Multithreading Test0.55failed2.9failed1.7failed
All Tests0.420.0941.90.651.20.34

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with MySQL server is much more efficient than Hibernate with SQLite embedded in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.34) to the normalized speed of OpenJPA with MySQL database server (1.2) reveals that in these tests, OpenJPA with MySQL server is 3.5 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.057) to the normalized speed of OpenJPA with MySQL database server (0.74) reveals that in that case, OpenJPA with MySQL server is 13.0 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test0.980.0611.70.911.40.49
Element Collection Test0.00990.00070.65failed0.330.0007
Inheritance Test0.0330.0581.50.900.750.48
Indexing Test0.640.0792.00.541.30.31
Graph (Binary Tree) Test0.410.240.430.800.420.52
Multithreading Test0.27failed2.9failed1.6failed
All Tests0.390.0881.50.790.960.40

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with MySQL server is more efficient than Hibernate with SQLite embedded in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.40) to the normalized speed of OpenJPA with MySQL database server (0.96) reveals that in these tests, OpenJPA with MySQL server is 2.4 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.061) to the normalized speed of OpenJPA with MySQL database server (0.98) reveals that in that case, OpenJPA with MySQL server is 16.1 times faster than Hibernate with SQLite embedded.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.60.636.00.814.80.72
Element Collection Test1.30.0921.40.691.30.19
Inheritance Test1.00.632.50.911.80.77
Indexing Test1.90.426.60.964.30.69
Graph (Binary Tree) Test0.450.330.400.770.430.55
Multithreading Test2.0failed5.5failed3.8failed
All Tests1.80.423.90.862.80.62

The results above show that in general OpenJPA with MySQL server is much more efficient than Hibernate with SQLite embedded in performing JPA database operations. Comparing the normalized speed of Hibernate with SQLite embedded database (0.62) to the normalized speed of OpenJPA with MySQL database server (2.8) reveals that in these tests, OpenJPA with MySQL server is 4.5 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.092) to the normalized speed of OpenJPA with MySQL database server (1.3) reveals that in that case, OpenJPA with MySQL server is 14.1 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons