Compare with

Comparison of Hibernate with SQLite embedded 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
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test0.0833.91.01.60.552.7
Element Collection Test0.0671.60.690.680.381.1
Inheritance Test0.0803.60.991.40.542.5
Indexing Test0.0985.61.02.40.554.0
Graph (Binary Tree) Test0.270.680.960.570.610.63
Multithreading Testfailed7.2failed2.7failed4.9
All Tests0.123.70.931.50.532.6

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
 Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test1.83.21.322.71.512.9
Element Collection Test0.00080.0038failed2.90.00081.4
Inheritance Test2.40.0171.46.91.93.4
Indexing Test1.92.42.323.42.112.9
Graph (Binary Tree) Test0.560.270.880.350.720.31
Multithreading Testfailed0.14failed18.1failed9.1
All Tests1.31.01.512.41.46.7

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
 Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test1.19.30.222.20.655.8
Element Collection Test0.394.8failed1.10.392.9
Inheritance Test0.531.50.280.900.401.2
Indexing Test0.00110.310.432.10.211.2
Multithreading Testfailed1.9failed0.99failed1.4
All Tests0.503.60.311.50.422.5

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
 Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test0.0760.740.651.60.371.2
Element Collection Test0.00220.014failed1.70.00220.87
Inheritance Test0.0790.0480.972.00.531.0
Indexing Test0.0570.740.543.00.301.9
Graph (Binary Tree) Test0.260.450.420.250.340.35
Multithreading Testfailed0.55failed2.9failed1.7
All Tests0.0940.420.651.90.341.2

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
 Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test0.0610.980.911.70.491.4
Element Collection Test0.00070.0099failed0.650.00070.33
Inheritance Test0.0580.0330.901.50.480.75
Indexing Test0.0790.640.542.00.311.3
Graph (Binary Tree) Test0.240.410.800.430.520.42
Multithreading Testfailed0.27failed2.9failed1.6
All Tests0.0880.390.791.50.400.96

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
 Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Hibernate
SQLite embedded
OpenJPA
MySQL server
Basic Person Test0.633.60.816.00.724.8
Element Collection Test0.0921.30.691.40.191.3
Inheritance Test0.631.00.912.50.771.8
Indexing Test0.421.90.966.60.694.3
Graph (Binary Tree) Test0.330.450.770.400.550.43
Multithreading Testfailed2.0failed5.5failed3.8
All Tests0.421.80.863.90.622.8

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