Compare with

Comparison of Hibernate with Derby server vs OpenJPA with Derby 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
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test3.83.13.02.73.42.9
Element Collection Test2.02.01.31.71.71.8
Inheritance Test3.43.03.02.33.22.6
Indexing Test4.84.74.14.14.44.4
Graph (Binary Tree) Test1.80.711.60.641.70.67
Multithreading Test6.96.03.93.85.44.9
All Tests3.83.32.82.53.32.9

The results above show that in general Hibernate with Derby server is slightly more efficient than OpenJPA with Derby server in persisting JPA entity objects to the database.

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.71) to the normalized speed of Hibernate with Derby database server (1.8) reveals that in that case, Hibernate with Derby server is 2.5 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test3.80.788.411.66.16.2
Element Collection Test1.00.00241.01.11.00.54
Inheritance Test3.50.0149.75.06.62.5
Indexing Test3.20.629.513.06.46.8
Graph (Binary Tree) Test0.910.0651.20.391.10.23
Multithreading Test7.81.613.419.010.610.3
All Tests3.40.517.28.45.34.4

The results above show that in general Hibernate with Derby server is slightly more efficient than OpenJPA with Derby server in retrieving JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.0024) to the normalized speed of Hibernate with Derby database server (1.0) reveals that in that case, Hibernate with Derby server is 417 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test34.029.24.15.519.117.3
Element Collection Test33.82.20.641.417.21.8
Inheritance Test20.52.25.01.012.81.6
Indexing Test2.02.29.211.75.67.0
Multithreading Test36.235.55.18.320.621.9
All Tests25.314.34.85.615.19.9

The results above show that in general Hibernate with Derby server is more efficient than OpenJPA with Derby server in executing the tested JPA queries.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (2.2) to the normalized speed of Hibernate with Derby database server (33.8) reveals that in that case, Hibernate with Derby server is 15.4 times faster than OpenJPA with Derby server.

On the other hand, Hibernate with Derby server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with Derby database server (0.64) to the normalized speed of OpenJPA with Derby database server (1.4) reveals that in that case, Hibernate with Derby server is 2.2 times slower than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test2.91.52.54.02.72.8
Element Collection Test2.30.00811.51.91.90.94
Inheritance Test2.90.0433.53.83.21.9
Indexing Test3.01.84.26.83.64.3
Graph (Binary Tree) Test1.20.160.580.270.910.22
Multithreading Test6.86.92.55.04.65.9
All Tests3.21.72.53.62.82.7

The results above show that in general Hibernate with Derby server is slightly more efficient than OpenJPA with Derby server in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.0081) to the normalized speed of Hibernate with Derby database server (2.3) reveals that in that case, Hibernate with Derby server is 284 times faster than OpenJPA with Derby server.

On the other hand, Hibernate with Derby server is slower, for instance, when using multithreading with large transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.5) to the normalized speed of OpenJPA with Derby database server (5.0) reveals that in that case, Hibernate with Derby server is 2.0 times slower than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test2.91.43.53.73.22.5
Element Collection Test1.70.00820.871.41.30.71
Inheritance Test2.90.0353.62.53.21.3
Indexing Test3.72.33.63.53.72.9
Graph (Binary Tree) Test0.690.130.700.350.700.24
Multithreading Test6.23.65.14.05.63.8
All Tests3.01.32.92.63.01.9

The results above show that in general Hibernate with Derby server is more efficient than OpenJPA with Derby server in deleting JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.0082) to the normalized speed of Hibernate with Derby database server (1.7) reveals that in that case, Hibernate with Derby server is 207 times faster than OpenJPA with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Hibernate
Derby server
OpenJPA
Derby server
Basic Person Test9.57.24.35.56.96.4
Element Collection Test8.20.841.11.54.61.2
Inheritance Test6.61.15.02.95.82.0
Indexing Test3.32.36.17.84.75.1
Graph (Binary Tree) Test1.20.271.00.411.10.34
Multithreading Test12.810.76.08.09.49.4
All Tests7.13.94.04.55.64.2

The results above show that in general Hibernate with Derby server is more efficient than OpenJPA with Derby server in performing JPA database operations.

A large performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.84) to the normalized speed of Hibernate with Derby database server (8.2) reveals that in that case, Hibernate with Derby server is 9.8 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons