Compare with

Comparison of Hibernate with Derby embedded 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
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test5.932.63.813.14.922.9
Element Collection Test2.915.11.88.22.311.7
Inheritance Test5.325.53.713.64.519.5
Indexing Test7.029.64.818.85.924.2
Graph (Binary Tree) Test1.913.81.715.61.814.7
Multithreading Test10.537.43.713.07.125.2
All Tests5.625.63.313.74.419.7

The results above show that in general Hibernate with HSQLDB embedded is much 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 Hibernate with HSQLDB embedded database (19.7) reveals that in these tests, Hibernate with HSQLDB embedded is 4.5 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 Hibernate with HSQLDB embedded database (15.6) reveals that in that case, Hibernate with HSQLDB embedded is 9.2 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
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test14.224.816.416.415.320.6
Element Collection Test4.411.34.910.84.611.0
Inheritance Test10.321.718.621.014.421.3
Indexing Test10.011.916.421.513.216.7
Graph (Binary Tree) Test2.63.63.04.72.84.1
Multithreading Test19.319.819.321.519.320.6
All Tests10.115.513.116.011.615.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test49.33.66.80.8828.12.2
Element Collection Test37.63.42.71.720.12.6
Inheritance Test24.12.97.61.015.91.9
Indexing Test5.39.914.821.710.115.8
Multithreading Test39.71.16.10.5822.90.82
All Tests31.24.27.65.219.44.7

The results above show that in general Hibernate with Derby embedded is much 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 Hibernate with Derby embedded database (19.4) reveals that in these tests, Hibernate with Derby embedded is 4.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 Hibernate with Derby embedded database (39.7) reveals that in that case, Hibernate with Derby embedded is 36.1 times faster than Hibernate with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test4.514.23.25.03.89.6
Element Collection Test3.910.13.15.63.57.8
Inheritance Test4.613.44.57.54.510.5
Indexing Test4.610.75.56.15.18.4
Graph (Binary Tree) Test2.73.71.22.52.03.1
Multithreading Test11.623.92.63.87.113.9
All Tests5.312.73.35.14.38.9

The results above show that in general Hibernate with HSQLDB embedded is more efficient than Hibernate with Derby embedded in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with Derby embedded database (4.3) to the normalized speed of Hibernate with HSQLDB embedded database (8.9) reveals that in these tests, Hibernate with HSQLDB embedded is 2.1 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 (4.5) to the normalized speed of Hibernate with HSQLDB embedded database (14.2) reveals that in that case, Hibernate with HSQLDB embedded is 3.2 times faster than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test3.826.14.217.54.021.8
Element Collection Test2.39.11.55.21.97.1
Inheritance Test4.021.44.317.74.219.6
Indexing Test5.533.03.616.34.624.7
Graph (Binary Tree) Test0.745.40.968.20.856.8
Multithreading Test5.638.54.928.65.333.5
All Tests3.722.33.315.63.518.9

The results above show that in general Hibernate 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 Hibernate with HSQLDB embedded database (18.9) reveals that in these tests, Hibernate with HSQLDB embedded is 5.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 (0.96) to the normalized speed of Hibernate with HSQLDB embedded database (8.2) reveals that in that case, Hibernate with HSQLDB embedded is 8.5 times faster than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test52.741.452.741.452.741.4
Element Collection Test42.346.942.346.942.346.9
Inheritance Test49.241.449.241.449.241.4
Indexing Test53.048.453.949.253.448.8
Graph (Binary Tree) Test13.128.59.821.411.525.0
Multithreading Test49.351.98.810.329.031.1
All Tests43.343.136.135.139.739.1

The results above show that in general Hibernate with Derby embedded is slightly more efficient than Hibernate 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 Hibernate with HSQLDB embedded database (21.4) reveals that in that case, Hibernate with Derby embedded is 2.2 times less efficient than Hibernate with HSQLDB embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Hibernate
Derby embedded
Hibernate
HSQLDB embedded
Basic Person Test15.520.26.910.611.215.4
Element Collection Test10.29.82.86.36.58.0
Inheritance Test9.717.07.712.28.714.6
Indexing Test6.519.09.016.97.818.0
Graph (Binary Tree) Test2.06.61.77.81.87.2
Multithreading Test17.324.17.313.512.318.8
All Tests10.516.56.111.38.313.9

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

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

Other Head to Head DBMS/JPA Comparisons