Compare with

Comparison of Hibernate with SQLite embedded vs OpenJPA with Derby 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
 Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test0.0834.81.02.90.553.9
Element Collection Test0.0672.80.691.90.382.4
Inheritance Test0.0804.10.992.40.543.3
Indexing Test0.0986.11.04.10.555.1
Graph (Binary Tree) Test0.271.50.961.40.611.4
Multithreading Testfailed8.7failed3.3failed6.0
All Tests0.124.70.932.70.533.7

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

The results above show that in general OpenJPA with Derby embedded 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 Derby embedded database (3.7) reveals that in these tests, OpenJPA with Derby embedded is 7.0 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 Derby embedded database (6.1) reveals that in that case, OpenJPA with Derby embedded is 62.2 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
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test1.814.81.322.61.518.7
Element Collection Test0.00080.0031failed2.30.00081.2
Inheritance Test2.40.0151.47.01.93.5
Indexing Test1.911.72.326.52.119.1
Graph (Binary Tree) Test0.560.930.881.20.721.1
Multithreading Testfailed25.2failed28.6failed26.9
All Tests1.38.81.514.71.411.7

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

The results above show that in general OpenJPA with Derby embedded 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 Derby embedded database (11.7) reveals that in these tests, OpenJPA with Derby embedded is 8.4 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 Derby embedded database (22.6) reveals that in that case, OpenJPA with Derby embedded is 17.4 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.015) to the normalized speed of Hibernate with SQLite embedded database (2.4) reveals that in that case, OpenJPA with Derby embedded is 160 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
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test1.149.70.229.90.6529.8
Element Collection Test0.392.7failed9.60.396.1
Inheritance Test0.532.30.281.30.401.8
Indexing Test0.00117.00.4317.10.2112.1
Multithreading Testfailed40.9failed11.7failed26.3
All Tests0.5020.50.319.90.4215.2

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

The results above show that in general OpenJPA with Derby embedded 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 Derby embedded database (15.2) reveals that in these tests, OpenJPA with Derby embedded is 36.2 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 Derby embedded database (7.0) reveals that in that case, OpenJPA with Derby embedded is 6,364 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
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test0.0765.60.655.20.375.4
Element Collection Test0.00220.0090failed2.20.00221.1
Inheritance Test0.0790.0450.974.60.532.3
Indexing Test0.0576.10.548.70.307.4
Graph (Binary Tree) Test0.261.60.420.910.341.3
Multithreading Testfailed18.3failed4.5failed11.4
All Tests0.0945.30.654.40.344.8

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

The results above show that in general OpenJPA with Derby embedded 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 Derby embedded database (4.8) reveals that in these tests, OpenJPA with Derby embedded is 14.1 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 Derby embedded database (6.1) reveals that in that case, OpenJPA with Derby embedded is 107 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
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test0.0614.20.914.50.494.3
Element Collection Test0.00070.0071failed1.60.00070.80
Inheritance Test0.0580.0350.903.00.481.5
Indexing Test0.0795.30.543.60.314.4
Graph (Binary Tree) Test0.240.800.800.930.520.86
Multithreading Testfailed5.7failed6.2failed6.0
All Tests0.0882.70.793.30.403.0

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

The results above show that in general OpenJPA with Derby embedded is much 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 Derby embedded database (3.0) reveals that in these tests, OpenJPA with Derby embedded is 7.5 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 Derby embedded database (4.2) reveals that in that case, OpenJPA with Derby embedded is 68.9 times faster than Hibernate with SQLite embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test90.252.890.252.890.252.8
Element Collection Test82.042.482.042.482.042.4
Inheritance Test80.544.280.544.280.544.2
Indexing Test93.453.194.854.094.153.5
Graph (Binary Tree) Test67.912.850.99.659.411.2
Multithreading Testfailed50.7failed9.7failed30.2
All Tests82.842.779.735.581.239.1

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

The results above show that in general Hibernate with SQLite embedded is more efficient than OpenJPA with Derby embedded in using disk space. Comparing the normalized score of OpenJPA with Derby embedded database (39.1) to the normalized score of Hibernate with SQLite embedded database (81.2) reveals that in these tests, Hibernate with SQLite embedded is 2.1 times more efficient than OpenJPA with Derby embedded.

A large gap has been detected when using graphs of objects with small transaction size. Comparing the normalized score of OpenJPA with Derby embedded database (12.8) to the normalized score of Hibernate with SQLite embedded database (67.9) reveals that in that case, Hibernate with SQLite embedded is 5.3 times more efficient than OpenJPA with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Basic Person Test0.6315.80.819.00.7212.4
Element Collection Test0.0921.10.693.50.192.3
Inheritance Test0.631.30.913.70.772.5
Indexing Test0.427.20.9612.00.699.6
Graph (Binary Tree) Test0.331.20.771.10.551.2
Multithreading Testfailed19.8failed10.9failed15.3
All Tests0.428.00.866.90.627.4

The results above show that in general OpenJPA with Derby embedded 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 Derby embedded database (7.4) reveals that in these tests, OpenJPA with Derby embedded is 11.9 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.63) to the normalized speed of OpenJPA with Derby embedded database (15.8) reveals that in that case, OpenJPA with Derby embedded is 25.1 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons