Compare with

Comparison of OpenJPA with Derby server vs Hibernate 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
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test3.15.92.73.82.94.9
Element Collection Test2.02.91.71.81.82.3
Inheritance Test3.05.32.33.72.64.5
Indexing Test4.77.04.14.84.45.9
Graph (Binary Tree) Test0.711.90.641.70.671.8
Multithreading Test6.010.53.83.74.97.1
All Tests3.35.62.53.32.94.4

The results above show that in general Hibernate with Derby embedded is 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 embedded database (1.9) reveals that in that case, Hibernate with Derby embedded is 2.7 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
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test0.7814.211.616.46.215.3
Element Collection Test0.00244.41.14.90.544.6
Inheritance Test0.01410.35.018.62.514.4
Indexing Test0.6210.013.016.46.813.2
Graph (Binary Tree) Test0.0652.60.393.00.232.8
Multithreading Test1.619.319.019.310.319.3
All Tests0.5110.18.413.14.411.6

The results above show that in general Hibernate with Derby embedded is more efficient than OpenJPA with Derby server in retrieving JPA entity objects from the database. Comparing the normalized speed of OpenJPA with Derby database server (4.4) to the normalized speed of Hibernate with Derby embedded database (11.6) reveals that in these tests, Hibernate with Derby embedded is 2.6 times faster than OpenJPA with Derby server.

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 embedded database (4.4) reveals that in that case, Hibernate with Derby embedded is 1,833 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
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test29.249.35.56.817.328.1
Element Collection Test2.237.61.42.71.820.1
Inheritance Test2.224.11.07.61.615.9
Indexing Test2.25.311.714.87.010.1
Multithreading Test35.539.78.36.121.922.9
All Tests14.331.25.67.69.919.4

The results above show that in general Hibernate with Derby embedded 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 embedded database (37.6) reveals that in that case, Hibernate with Derby embedded is 17.1 times faster than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test1.54.54.03.22.83.8
Element Collection Test0.00813.91.93.10.943.5
Inheritance Test0.0434.63.84.51.94.5
Indexing Test1.84.66.85.54.35.1
Graph (Binary Tree) Test0.162.70.271.20.222.0
Multithreading Test6.911.65.02.65.97.1
All Tests1.75.33.63.32.74.3

The results above show that in general Hibernate with Derby embedded is 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 embedded database (3.9) reveals that in that case, Hibernate with Derby embedded is 481 times faster than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test1.43.83.74.22.54.0
Element Collection Test0.00822.31.41.50.711.9
Inheritance Test0.0354.02.54.31.34.2
Indexing Test2.35.53.53.62.94.6
Graph (Binary Tree) Test0.130.740.350.960.240.85
Multithreading Test3.65.64.04.93.85.3
All Tests1.33.72.63.31.93.5

The results above show that in general Hibernate with Derby embedded 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 embedded database (2.3) reveals that in that case, Hibernate with Derby embedded is 280 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
 OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
Basic Person Test7.215.55.56.96.411.2
Element Collection Test0.8410.21.52.81.26.5
Inheritance Test1.19.72.97.72.08.7
Indexing Test2.36.57.89.05.17.8
Graph (Binary Tree) Test0.272.00.411.70.341.8
Multithreading Test10.717.38.07.39.412.3
All Tests3.910.54.56.14.28.3

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

A huge 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 embedded database (10.2) reveals that in that case, Hibernate with Derby embedded is 12.1 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons