Compare with

Comparison of OpenJPA with H2 server 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
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test3.73.82.23.02.93.4
Element Collection Test2.62.01.51.32.11.7
Inheritance Test4.53.42.03.03.23.2
Indexing Test7.34.83.64.15.44.4
Graph (Binary Tree) Test1.11.80.841.60.971.7
Multithreading Test7.76.94.23.95.95.4
All Tests4.53.82.42.83.43.3

The results above show that in general OpenJPA with H2 server 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
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test2.93.87.68.45.26.1
Element Collection Test0.00221.01.91.00.931.0
Inheritance Test0.0133.54.09.72.06.6
Indexing Test4.13.28.89.56.56.4
Graph (Binary Tree) Test0.380.910.491.20.441.1
Multithreading Test5.97.814.013.410.010.6
All Tests2.23.46.17.24.25.3

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.0022) to the normalized speed of Hibernate with Derby database server (1.0) reveals that in that case, Hibernate with Derby server is 455 times faster than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test3.734.01.04.12.419.1
Element Collection Test2.033.81.20.641.617.2
Inheritance Test2.820.51.15.02.012.8
Indexing Test3.82.07.59.25.75.6
Multithreading Test0.9836.21.05.11.020.6
All Tests2.725.32.44.82.515.1

The results above show that in general Hibernate with Derby server is much more efficient than OpenJPA with H2 server in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 database server (2.5) to the normalized speed of Hibernate with Derby database server (15.1) reveals that in these tests, Hibernate with Derby server is 6.0 times faster than OpenJPA with H2 server.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.98) to the normalized speed of Hibernate with Derby database server (36.2) reveals that in that case, Hibernate with Derby server is 36.9 times faster than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test3.02.92.02.52.52.7
Element Collection Test0.00782.31.91.50.941.9
Inheritance Test0.0342.92.83.51.43.2
Indexing Test2.83.03.24.23.03.6
Graph (Binary Tree) Test0.791.20.430.580.610.91
Multithreading Test7.06.82.52.54.84.6
All Tests2.33.22.12.52.22.8

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test3.22.92.23.52.73.2
Element Collection Test0.00601.70.880.870.441.3
Inheritance Test0.0302.93.13.61.63.2
Indexing Test6.53.73.63.65.13.7
Graph (Binary Tree) Test0.730.690.750.700.740.70
Multithreading Test7.66.25.25.16.45.6
All Tests3.03.02.62.92.83.0

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
OpenJPA
H2 server
Hibernate
Derby server
Basic Person Test3.39.53.04.33.16.9
Element Collection Test0.938.21.51.11.24.6
Inheritance Test1.56.62.65.02.05.8
Indexing Test4.93.35.46.15.14.7
Graph (Binary Tree) Test0.751.20.631.00.691.1
Multithreading Test5.912.85.46.05.69.4
All Tests2.97.13.24.03.05.6

The results above show that in general Hibernate with Derby server is more efficient than OpenJPA with H2 server 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 H2 database server (0.93) to the normalized speed of Hibernate with Derby database server (8.2) reveals that in that case, Hibernate with Derby server is 8.8 times faster than OpenJPA with H2 server.

Other Head to Head DBMS/JPA Comparisons