Compare with

Comparison of OpenJPA with HSQLDB embedded vs Hibernate 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
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test13.35.96.93.810.14.9
Element Collection Test8.62.95.31.87.02.3
Inheritance Test12.25.35.83.79.04.5
Indexing Test16.77.09.14.812.95.9
Graph (Binary Tree) Test6.11.97.31.76.71.8
Multithreading Test26.810.57.03.716.97.1
All Tests13.95.66.93.310.44.4

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than Hibernate with Derby embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with Derby embedded database (4.4) to the normalized speed of OpenJPA with HSQLDB embedded database (10.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.4 times faster than Hibernate with Derby embedded.

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (1.7) to the normalized speed of OpenJPA with HSQLDB embedded database (7.3) reveals that in that case, OpenJPA with HSQLDB embedded is 4.3 times faster than Hibernate with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test21.814.230.116.425.915.3
Element Collection Test0.00684.44.54.92.24.6
Inheritance Test0.002510.32.018.60.9814.4
Indexing Test22.110.043.616.432.913.2
Graph (Binary Tree) Test2.12.62.13.02.12.8
Multithreading Test20.919.323.519.322.219.3
All Tests11.110.117.613.114.411.6

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

A large performance gap has been detected when using database indexes with large retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (16.4) to the normalized speed of OpenJPA with HSQLDB embedded database (43.6) reveals that in that case, OpenJPA with HSQLDB embedded is 2.7 times faster than Hibernate with Derby embedded.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0025) to the normalized speed of Hibernate with Derby embedded database (10.3) reveals that in that case, OpenJPA with HSQLDB embedded is 4,120 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
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test2.849.30.916.81.928.1
Element Collection Test1.437.60.952.71.220.1
Inheritance Test2.424.11.37.61.815.9
Indexing Test15.45.334.314.824.910.1
Multithreading Test1.439.70.536.10.9522.9
All Tests4.731.27.67.66.119.4

The results above show that in general Hibernate with Derby embedded is much more efficient than OpenJPA with HSQLDB embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (6.1) to the normalized speed of Hibernate with Derby embedded database (19.4) reveals that in these tests, Hibernate with Derby embedded is 3.2 times faster than OpenJPA with HSQLDB embedded.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of Hibernate with Derby embedded database (39.7) reveals that in that case, Hibernate with Derby embedded is 28.4 times faster than OpenJPA with HSQLDB embedded.

On the other hand, Hibernate with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (5.3) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, Hibernate with Derby embedded is 2.9 times slower than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test12.04.55.33.28.63.8
Element Collection Test0.0173.93.73.11.83.5
Inheritance Test0.00984.62.04.50.994.5
Indexing Test9.34.65.55.57.45.1
Graph (Binary Tree) Test2.52.71.61.22.12.0
Multithreading Test20.011.63.72.611.87.1
All Tests7.35.33.63.35.54.3

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

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (4.5) to the normalized speed of OpenJPA with HSQLDB embedded database (12.0) reveals that in that case, OpenJPA with HSQLDB embedded is 2.7 times faster than Hibernate with Derby embedded.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of Hibernate with Derby embedded database (4.6) reveals that in that case, OpenJPA with HSQLDB embedded is 469 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
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test21.33.815.74.218.54.0
Element Collection Test0.0112.32.91.51.51.9
Inheritance Test0.00704.03.54.31.84.2
Indexing Test28.85.515.23.622.04.6
Graph (Binary Tree) Test2.90.743.60.963.20.85
Multithreading Test26.05.619.64.922.85.3
All Tests13.23.710.13.311.63.5

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than Hibernate with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with Derby embedded database (3.5) to the normalized speed of OpenJPA with HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.3 times faster than Hibernate with Derby embedded.

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

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0070) to the normalized speed of Hibernate with Derby embedded database (4.0) reveals that in that case, OpenJPA with HSQLDB embedded is 571 times slower than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test41.452.741.452.741.452.7
Element Collection Test46.942.346.942.346.942.3
Inheritance Test41.449.241.449.241.449.2
Indexing Test48.453.049.253.948.853.4
Graph (Binary Tree) Test28.513.121.49.825.011.5
Multithreading Test51.949.310.38.831.129.0
All Tests43.143.335.136.139.139.7

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

On the other hand, Hibernate with Derby embedded is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized score of Hibernate with Derby embedded database (9.8) to the normalized score of OpenJPA with HSQLDB embedded database (21.4) reveals that in that case, Hibernate with Derby embedded is 2.2 times less efficient than OpenJPA with HSQLDB embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
OpenJPA
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test14.315.511.86.913.011.2
Element Collection Test2.010.23.52.82.76.5
Inheritance Test2.99.72.97.72.98.7
Indexing Test18.56.521.69.020.07.8
Graph (Binary Tree) Test3.42.03.71.73.51.8
Multithreading Test19.017.310.97.314.912.3
All Tests10.210.59.26.19.78.3

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

A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (6.5) to the normalized speed of OpenJPA with HSQLDB embedded database (18.5) reveals that in that case, OpenJPA with HSQLDB embedded is 2.8 times faster than Hibernate with Derby embedded.

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

Other Head to Head DBMS/JPA Comparisons