Compare with

Comparison of Hibernate with Derby embedded 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 embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test5.93.13.82.74.92.9
Element Collection Test2.92.01.81.72.31.8
Inheritance Test5.33.03.72.34.52.6
Indexing Test7.04.74.84.15.94.4
Graph (Binary Tree) Test1.90.711.70.641.80.67
Multithreading Test10.56.03.73.87.14.9
All Tests5.63.33.32.54.42.9

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
 Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test14.20.7816.411.615.36.2
Element Collection Test4.40.00244.91.14.60.54
Inheritance Test10.30.01418.65.014.42.5
Indexing Test10.00.6216.413.013.26.8
Graph (Binary Tree) Test2.60.0653.00.392.80.23
Multithreading Test19.31.619.319.019.310.3
All Tests10.10.5113.18.411.64.4

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
 Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test49.329.26.85.528.117.3
Element Collection Test37.62.22.71.420.11.8
Inheritance Test24.12.27.61.015.91.6
Indexing Test5.32.214.811.710.17.0
Multithreading Test39.735.56.18.322.921.9
All Tests31.214.37.65.619.49.9

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
 Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test4.51.53.24.03.82.8
Element Collection Test3.90.00813.11.93.50.94
Inheritance Test4.60.0434.53.84.51.9
Indexing Test4.61.85.56.85.14.3
Graph (Binary Tree) Test2.70.161.20.272.00.22
Multithreading Test11.66.92.65.07.15.9
All Tests5.31.73.33.64.32.7

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
 Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test3.81.44.23.74.02.5
Element Collection Test2.30.00821.51.41.90.71
Inheritance Test4.00.0354.32.54.21.3
Indexing Test5.52.33.63.54.62.9
Graph (Binary Tree) Test0.740.130.960.350.850.24
Multithreading Test5.63.64.94.05.33.8
All Tests3.71.33.32.63.51.9

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
 Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Hibernate
Derby embedded
OpenJPA
Derby server
Basic Person Test15.57.26.95.511.26.4
Element Collection Test10.20.842.81.56.51.2
Inheritance Test9.71.17.72.98.72.0
Indexing Test6.52.39.07.87.85.1
Graph (Binary Tree) Test2.00.271.70.411.80.34
Multithreading Test17.310.77.38.012.39.4
All Tests10.53.96.14.58.34.2

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