Compare with

Comparison of Hibernate with Derby 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
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test5.94.83.82.94.93.9
Element Collection Test2.92.81.81.92.32.4
Inheritance Test5.34.13.72.44.53.3
Indexing Test7.06.14.84.15.95.1
Graph (Binary Tree) Test1.91.51.71.41.81.4
Multithreading Test10.58.73.73.37.16.0
All Tests5.64.73.32.74.43.7

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test14.214.816.422.615.318.7
Element Collection Test4.40.00314.92.34.61.2
Inheritance Test10.30.01518.67.014.43.5
Indexing Test10.011.716.426.513.219.1
Graph (Binary Tree) Test2.60.933.01.22.81.1
Multithreading Test19.325.219.328.619.326.9
All Tests10.18.813.114.711.611.7

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

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0031) to the normalized speed of Hibernate with Derby embedded database (4.4) reveals that in that case, OpenJPA with Derby embedded is 1,419 times slower than Hibernate with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test49.349.76.89.928.129.8
Element Collection Test37.62.72.79.620.16.1
Inheritance Test24.12.37.61.315.91.8
Indexing Test5.37.014.817.110.112.1
Multithreading Test39.740.96.111.722.926.3
All Tests31.220.57.69.919.415.2

The results above show that in general Hibernate with Derby embedded is slightly more efficient than OpenJPA with Derby embedded 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 embedded database (2.7) to the normalized speed of Hibernate with Derby embedded database (37.6) reveals that in that case, Hibernate with Derby embedded is 13.9 times faster than OpenJPA with Derby embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test4.55.63.25.23.85.4
Element Collection Test3.90.00903.12.23.51.1
Inheritance Test4.60.0454.54.64.52.3
Indexing Test4.66.15.58.75.17.4
Graph (Binary Tree) Test2.71.61.20.912.01.3
Multithreading Test11.618.32.64.57.111.4
All Tests5.35.33.34.44.34.8

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

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0090) to the normalized speed of Hibernate with Derby embedded database (3.9) reveals that in that case, OpenJPA with Derby embedded is 433 times slower than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test3.84.24.24.54.04.3
Element Collection Test2.30.00711.51.61.90.80
Inheritance Test4.00.0354.33.04.21.5
Indexing Test5.55.33.63.64.64.4
Graph (Binary Tree) Test0.740.800.960.930.850.86
Multithreading Test5.65.74.96.25.36.0
All Tests3.72.73.33.33.53.0

The results above show that in general Hibernate with Derby embedded is slightly more efficient than OpenJPA with Derby embedded 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 embedded database (0.0071) to the normalized speed of Hibernate with Derby embedded database (2.3) reveals that in that case, Hibernate with Derby embedded is 324 times faster than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test52.752.852.752.852.752.8
Element Collection Test42.342.442.342.442.342.4
Inheritance Test49.244.249.244.249.244.2
Indexing Test53.053.153.954.053.453.5
Graph (Binary Tree) Test13.112.89.89.611.511.2
Multithreading Test49.350.78.89.729.030.2
All Tests43.342.736.135.539.739.1

The results above show that in general Hibernate with Derby embedded is slightly more efficient than OpenJPA with Derby embedded in using disk space.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Hibernate
Derby embedded
OpenJPA
Derby embedded
Basic Person Test15.515.86.99.011.212.4
Element Collection Test10.21.12.83.56.52.3
Inheritance Test9.71.37.73.78.72.5
Indexing Test6.57.29.012.07.89.6
Graph (Binary Tree) Test2.01.21.71.11.81.2
Multithreading Test17.319.87.310.912.315.3
All Tests10.58.06.16.98.37.4

The results above show that in general Hibernate with Derby embedded is slightly more efficient than OpenJPA with Derby embedded 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 embedded database (1.1) to the normalized speed of Hibernate with Derby embedded database (10.2) reveals that in that case, Hibernate with Derby embedded is 9.3 times faster than OpenJPA with Derby embedded.

Other Head to Head DBMS/JPA Comparisons