Compare with

Comparison of Hibernate with Derby embedded vs DataNucleus 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
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test5.914.23.84.84.99.5
Element Collection Test2.96.61.82.12.34.3
Inheritance Test5.313.63.74.64.59.1
Indexing Test7.024.64.811.15.917.8
Graph (Binary Tree) Test1.96.81.74.51.85.7
Multithreading Test10.538.53.78.57.123.5
All Tests5.617.43.35.94.411.7

The results above show that in general DataNucleus 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 DataNucleus with HSQLDB embedded database (11.7) reveals that in these tests, DataNucleus with HSQLDB embedded is 2.7 times faster than Hibernate with Derby embedded.

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (10.5) to the normalized speed of DataNucleus with HSQLDB embedded database (38.5) reveals that in that case, DataNucleus with HSQLDB embedded is 3.7 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
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test14.26.616.410.215.38.4
Element Collection Test4.43.64.98.14.65.8
Inheritance Test10.35.718.68.814.47.2
Indexing Test10.05.116.49.513.27.3
Graph (Binary Tree) Test2.67.23.09.32.88.3
Multithreading Test19.38.119.39.519.38.8
All Tests10.16.013.19.211.67.6

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

A large performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (8.1) to the normalized speed of Hibernate with Derby embedded database (19.3) reveals that in that case, Hibernate with Derby embedded is 2.4 times faster than DataNucleus with HSQLDB embedded.

On the other hand, Hibernate with Derby embedded is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (3.0) to the normalized speed of DataNucleus with HSQLDB embedded database (9.3) reveals that in that case, Hibernate with Derby embedded is 3.1 times slower than DataNucleus with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test49.31.46.80.4828.10.95
Element Collection Test37.61.32.70.6720.11.0
Inheritance Test24.11.67.60.6115.91.1
Indexing Test5.30.001614.80.6310.10.32
Multithreading Test39.70.406.1failed22.90.40
All Tests31.20.967.60.6019.40.80

DataNucleus with HSQLDB embedded has failed in 1 tests (see exceptions).

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (0.0016) to the normalized speed of Hibernate with Derby embedded database (5.3) reveals that in that case, Hibernate with Derby embedded is 3,312 times faster than DataNucleus with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test4.511.53.22.73.87.1
Element Collection Test3.96.93.12.73.54.8
Inheritance Test4.610.34.53.64.56.9
Indexing Test4.611.45.54.45.17.9
Graph (Binary Tree) Test2.73.51.21.52.02.5
Multithreading Test11.6failed2.6failed7.1failed
All Tests5.38.73.33.04.35.8

DataNucleus with HSQLDB embedded has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with HSQLDB embedded is 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 DataNucleus with HSQLDB embedded database (11.5) reveals that in that case, DataNucleus with HSQLDB embedded is 2.6 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
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test3.84.24.21.34.02.8
Element Collection Test2.34.91.51.61.93.2
Inheritance Test4.04.04.31.34.22.7
Indexing Test5.57.53.61.94.64.7
Graph (Binary Tree) Test0.742.90.962.00.852.5
Multithreading Test5.640.14.913.75.326.9
All Tests3.710.63.33.73.57.1

The results above show that in general DataNucleus with HSQLDB embedded is 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 DataNucleus with HSQLDB embedded database (7.1) reveals that in these tests, DataNucleus with HSQLDB embedded is 2.0 times faster than Hibernate with Derby embedded.

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (5.6) to the normalized speed of DataNucleus with HSQLDB embedded database (40.1) reveals that in that case, DataNucleus with HSQLDB embedded is 7.2 times faster than Hibernate with Derby embedded.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of Hibernate with Derby embedded database (4.3) reveals that in that case, DataNucleus with HSQLDB embedded is 3.3 times slower than Hibernate with Derby embedded.

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

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test15.57.66.93.911.25.7
Element Collection Test10.24.72.83.06.53.8
Inheritance Test9.77.17.73.88.75.4
Indexing Test6.59.79.05.57.87.6
Graph (Binary Tree) Test2.05.11.74.31.84.7
Multithreading Test17.321.87.310.612.317.0
All Tests10.59.06.14.88.37.0

The results above show that in general Hibernate with Derby embedded is slightly more efficient than DataNucleus with HSQLDB embedded 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 DataNucleus with HSQLDB embedded database (4.7) to the normalized speed of Hibernate with Derby embedded database (10.2) reveals that in that case, Hibernate with Derby embedded is 2.2 times faster than DataNucleus with HSQLDB embedded.

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

Other Head to Head DBMS/JPA Comparisons