Compare with

Comparison of OpenJPA with Derby embedded vs Hibernate 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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test4.83.82.93.03.93.4
Element Collection Test2.82.01.91.32.41.7
Inheritance Test4.13.42.43.03.33.2
Indexing Test6.14.84.14.15.14.4
Graph (Binary Tree) Test1.51.81.41.61.41.7
Multithreading Test8.76.93.33.96.05.4
All Tests4.73.82.72.83.73.3

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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test14.83.822.68.418.76.1
Element Collection Test0.00311.02.31.01.21.0
Inheritance Test0.0153.57.09.73.56.6
Indexing Test11.73.226.59.519.16.4
Graph (Binary Tree) Test0.930.911.21.21.11.1
Multithreading Test25.27.828.613.426.910.6
All Tests8.83.414.77.211.75.3

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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test49.734.09.94.129.819.1
Element Collection Test2.733.89.60.646.117.2
Inheritance Test2.320.51.35.01.812.8
Indexing Test7.02.017.19.212.15.6
Multithreading Test40.936.211.75.126.320.6
All Tests20.525.39.94.815.215.1

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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test5.62.95.22.55.42.7
Element Collection Test0.00902.32.21.51.11.9
Inheritance Test0.0452.94.63.52.33.2
Indexing Test6.13.08.74.27.43.6
Graph (Binary Tree) Test1.61.20.910.581.30.91
Multithreading Test18.36.84.52.511.44.6
All Tests5.33.24.42.54.82.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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test4.22.94.53.54.33.2
Element Collection Test0.00711.71.60.870.801.3
Inheritance Test0.0352.93.03.61.53.2
Indexing Test5.33.73.63.64.43.7
Graph (Binary Tree) Test0.800.690.930.700.860.70
Multithreading Test5.76.26.25.16.05.6
All Tests2.73.03.32.93.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
 OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
OpenJPA
Derby embedded
Hibernate
Derby server
Basic Person Test15.89.59.04.312.46.9
Element Collection Test1.18.23.51.12.34.6
Inheritance Test1.36.63.75.02.55.8
Indexing Test7.23.312.06.19.64.7
Graph (Binary Tree) Test1.21.21.11.01.21.1
Multithreading Test19.812.810.96.015.39.4
All Tests8.07.16.94.07.45.6

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