Compare with

Comparison of Hibernate with Derby server 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 server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test3.84.83.02.93.43.9
Element Collection Test2.02.81.31.91.72.4
Inheritance Test3.44.13.02.43.23.3
Indexing Test4.86.14.14.14.45.1
Graph (Binary Tree) Test1.81.51.61.41.71.4
Multithreading Test6.98.73.93.35.46.0
All Tests3.84.72.82.73.33.7

The results above show that in general OpenJPA with Derby embedded is slightly more efficient than Hibernate with Derby server 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 server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test3.814.88.422.66.118.7
Element Collection Test1.00.00311.02.31.01.2
Inheritance Test3.50.0159.77.06.63.5
Indexing Test3.211.79.526.56.419.1
Graph (Binary Tree) Test0.910.931.21.21.11.1
Multithreading Test7.825.213.428.610.626.9
All Tests3.48.87.214.75.311.7

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

A large performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of Hibernate with Derby database server (3.8) to the normalized speed of OpenJPA with Derby embedded database (14.8) reveals that in that case, OpenJPA with Derby embedded is 3.9 times faster than Hibernate with Derby server.

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 database server (1.0) reveals that in that case, OpenJPA with Derby embedded is 323 times slower than Hibernate 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 embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test34.049.74.19.919.129.8
Element Collection Test33.82.70.649.617.26.1
Inheritance Test20.52.35.01.312.81.8
Indexing Test2.07.09.217.15.612.1
Multithreading Test36.240.95.111.720.626.3
All Tests25.320.54.89.915.115.2

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

A huge performance gap has been detected 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 embedded database (9.6) reveals that in that case, OpenJPA with Derby embedded is 15.0 times faster than Hibernate with Derby server.

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 (2.7) to the normalized speed of Hibernate with Derby database server (33.8) reveals that in that case, OpenJPA with Derby embedded is 12.5 times slower than Hibernate 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 embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test2.95.62.55.22.75.4
Element Collection Test2.30.00901.52.21.91.1
Inheritance Test2.90.0453.54.63.22.3
Indexing Test3.06.14.28.73.67.4
Graph (Binary Tree) Test1.21.60.580.910.911.3
Multithreading Test6.818.32.54.54.611.4
All Tests3.25.32.54.42.84.8

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (6.8) to the normalized speed of OpenJPA with Derby embedded database (18.3) reveals that in that case, OpenJPA with Derby embedded is 2.7 times faster than Hibernate with Derby server.

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 database server (2.3) reveals that in that case, OpenJPA with Derby embedded is 256 times slower than Hibernate 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 embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test2.94.23.54.53.24.3
Element Collection Test1.70.00710.871.61.30.80
Inheritance Test2.90.0353.63.03.21.5
Indexing Test3.75.33.63.63.74.4
Graph (Binary Tree) Test0.690.800.700.930.700.86
Multithreading Test6.25.75.16.25.66.0
All Tests3.02.72.93.33.03.0

The results above show that in general OpenJPA with Derby embedded is equivalent to Hibernate with Derby server in deleting 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 transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0071) to the normalized speed of Hibernate with Derby database server (1.7) reveals that in that case, OpenJPA with Derby embedded is 239 times slower than Hibernate 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 embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Basic Person Test9.515.84.39.06.912.4
Element Collection Test8.21.11.13.54.62.3
Inheritance Test6.61.35.03.75.82.5
Indexing Test3.37.26.112.04.79.6
Graph (Binary Tree) Test1.21.21.01.11.11.2
Multithreading Test12.819.86.010.99.415.3
All Tests7.18.04.06.95.67.4

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

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

On the other hand, OpenJPA with Derby embedded is slower, for instance, 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 database server (8.2) reveals that in that case, OpenJPA with Derby embedded is 7.5 times slower than Hibernate with Derby server.

Other Head to Head DBMS/JPA Comparisons