Compare with

Comparison of OpenJPA with Derby embedded 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
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test4.80.0832.91.03.90.55
Element Collection Test2.80.0671.90.692.40.38
Inheritance Test4.10.0802.40.993.30.54
Indexing Test6.10.0984.11.05.10.55
Graph (Binary Tree) Test1.50.271.40.961.40.61
Multithreading Test8.7failed3.3failed6.0failed
All Tests4.70.122.70.933.70.53

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test14.81.822.61.318.71.5
Element Collection Test0.00310.00082.3failed1.20.0008
Inheritance Test0.0152.47.01.43.51.9
Indexing Test11.71.926.52.319.12.1
Graph (Binary Tree) Test0.930.561.20.881.10.72
Multithreading Test25.2failed28.6failed26.9failed
All Tests8.81.314.71.511.71.4

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test49.71.19.90.2229.80.65
Element Collection Test2.70.399.6failed6.10.39
Inheritance Test2.30.531.30.281.80.40
Indexing Test7.00.001117.10.4312.10.21
Multithreading Test40.9failed11.7failed26.3failed
All Tests20.50.509.90.3115.20.42

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test5.60.0765.20.655.40.37
Element Collection Test0.00900.00222.2failed1.10.0022
Inheritance Test0.0450.0794.60.972.30.53
Indexing Test6.10.0578.70.547.40.30
Graph (Binary Tree) Test1.60.260.910.421.30.34
Multithreading Test18.3failed4.5failed11.4failed
All Tests5.30.0944.40.654.80.34

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test4.20.0614.50.914.30.49
Element Collection Test0.00710.00071.6failed0.800.0007
Inheritance Test0.0350.0583.00.901.50.48
Indexing Test5.30.0793.60.544.40.31
Graph (Binary Tree) Test0.800.240.930.800.860.52
Multithreading Test5.7failed6.2failed6.0failed
All Tests2.70.0883.30.793.00.40

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test52.890.252.890.252.890.2
Element Collection Test42.482.042.482.042.482.0
Inheritance Test44.280.544.280.544.280.5
Indexing Test53.193.454.094.853.594.1
Graph (Binary Tree) Test12.867.99.650.911.259.4
Multithreading Test50.7failed9.7failed30.2failed
All Tests42.782.835.579.739.181.2

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
 OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
OpenJPA
Derby embedded
Hibernate
SQLite embedded
Basic Person Test15.80.639.00.8112.40.72
Element Collection Test1.10.0923.50.692.30.19
Inheritance Test1.30.633.70.912.50.77
Indexing Test7.20.4212.00.969.60.69
Graph (Binary Tree) Test1.20.331.10.771.20.55
Multithreading Test19.8failed10.9failed15.3failed
All Tests8.00.426.90.867.40.62

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