Compare with

Comparison of OpenJPA with Derby server vs Hibernate with HSQLDB 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
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test3.132.62.713.12.922.9
Element Collection Test2.015.11.78.21.811.7
Inheritance Test3.025.52.313.62.619.5
Indexing Test4.729.64.118.84.424.2
Graph (Binary Tree) Test0.7113.80.6415.60.6714.7
Multithreading Test6.037.43.813.04.925.2
All Tests3.325.62.513.72.919.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test0.7824.811.616.46.220.6
Element Collection Test0.002411.31.110.80.5411.0
Inheritance Test0.01421.75.021.02.521.3
Indexing Test0.6211.913.021.56.816.7
Graph (Binary Tree) Test0.0653.60.394.70.234.1
Multithreading Test1.619.819.021.510.320.6
All Tests0.5115.58.416.04.415.7

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.0024) to the normalized speed of Hibernate with HSQLDB embedded database (11.3) reveals that in that case, Hibernate with HSQLDB embedded is 4,708 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test29.23.65.50.8817.32.2
Element Collection Test2.23.41.41.71.82.6
Inheritance Test2.22.91.01.01.61.9
Indexing Test2.29.911.721.77.015.8
Multithreading Test35.51.18.30.5821.90.82
All Tests14.34.25.65.29.94.7

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test1.514.24.05.02.89.6
Element Collection Test0.008110.11.95.60.947.8
Inheritance Test0.04313.43.87.51.910.5
Indexing Test1.810.76.86.14.38.4
Graph (Binary Tree) Test0.163.70.272.50.223.1
Multithreading Test6.923.95.03.85.913.9
All Tests1.712.73.65.12.78.9

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.0081) to the normalized speed of Hibernate with HSQLDB embedded database (10.1) reveals that in that case, Hibernate with HSQLDB embedded is 1,247 times faster than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test1.426.13.717.52.521.8
Element Collection Test0.00829.11.45.20.717.1
Inheritance Test0.03521.42.517.71.319.6
Indexing Test2.333.03.516.32.924.7
Graph (Binary Tree) Test0.135.40.358.20.246.8
Multithreading Test3.638.54.028.63.833.5
All Tests1.322.32.615.61.918.9

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.0082) to the normalized speed of Hibernate with HSQLDB embedded database (9.1) reveals that in that case, Hibernate with HSQLDB embedded is 1,110 times faster than OpenJPA with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
OpenJPA
Derby server
Hibernate
HSQLDB embedded
Basic Person Test7.220.25.510.66.415.4
Element Collection Test0.849.81.56.31.28.0
Inheritance Test1.117.02.912.22.014.6
Indexing Test2.319.07.816.95.118.0
Graph (Binary Tree) Test0.276.60.417.80.347.2
Multithreading Test10.724.18.013.59.418.8
All Tests3.916.54.511.34.213.9

The results above show that in general Hibernate with HSQLDB embedded is much more efficient than OpenJPA with Derby server in performing JPA database operations. Comparing the normalized speed of OpenJPA with Derby database server (4.2) to the normalized speed of Hibernate with HSQLDB embedded database (13.9) reveals that in these tests, Hibernate with HSQLDB embedded is 3.3 times faster than OpenJPA with Derby server.

A huge performance gap has been detected when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.27) to the normalized speed of Hibernate with HSQLDB embedded database (6.6) reveals that in that case, Hibernate with HSQLDB embedded is 24.4 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons