Compare with

Comparison of Hibernate with H2 embedded vs EclipseLink 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
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test18.15.59.03.713.54.6
Element Collection Test13.03.06.81.79.92.4
Inheritance Test21.05.39.43.515.24.4
Indexing Test29.96.918.44.624.15.8
Graph (Binary Tree) Test17.22.020.11.918.71.9
Multithreading Test36.99.311.54.124.26.7
All Tests22.65.312.53.217.64.3

The results above show that in general Hibernate with H2 embedded is much more efficient than EclipseLink with Derby embedded in persisting JPA entity objects to the database. Comparing the normalized speed of EclipseLink with Derby embedded database (4.3) to the normalized speed of Hibernate with H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 4.1 times faster than EclipseLink with Derby embedded.

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (1.9) to the normalized speed of Hibernate with H2 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 10.6 times faster than EclipseLink with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test16.616.413.358.715.037.5
Element Collection Test4.37.54.013.34.110.4
Inheritance Test10.417.117.558.913.938.0
Indexing Test10.814.215.267.413.040.8
Graph (Binary Tree) Test2.52.84.05.73.34.2
Multithreading Test16.228.015.748.715.938.4
All Tests10.114.311.642.110.928.2

The results above show that in general EclipseLink with Derby embedded is more efficient than Hibernate with H2 embedded in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with H2 embedded database (10.9) to the normalized speed of EclipseLink with Derby embedded database (28.2) reveals that in these tests, EclipseLink with Derby embedded is 2.6 times faster than Hibernate with H2 embedded.

A large performance gap has been detected when using database indexes with large retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (15.2) to the normalized speed of EclipseLink with Derby embedded database (67.4) reveals that in that case, EclipseLink with Derby embedded is 4.4 times faster than Hibernate with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test4.553.41.213.82.833.6
Element Collection Test4.437.91.44.42.921.2
Inheritance Test3.137.41.515.02.326.2
Indexing Test6.67.610.549.38.628.4
Multithreading Test1.241.20.596.10.8923.6
All Tests4.035.53.017.73.526.6

The results above show that in general EclipseLink with Derby embedded is much more efficient than Hibernate with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 embedded database (3.5) to the normalized speed of EclipseLink with Derby embedded database (26.6) reveals that in these tests, EclipseLink with Derby embedded is 7.6 times faster than Hibernate with H2 embedded.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (1.2) to the normalized speed of EclipseLink with Derby embedded database (41.2) reveals that in that case, EclipseLink with Derby embedded is 34.3 times faster than Hibernate with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test12.16.46.56.79.36.5
Element Collection Test7.45.45.36.26.35.8
Inheritance Test10.86.58.59.29.67.8
Indexing Test10.07.37.511.18.89.2
Graph (Binary Tree) Test4.42.82.31.73.42.2
Multithreading Test16.221.34.05.010.113.1
All Tests10.18.35.76.67.97.5

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test19.74.611.44.715.54.6
Element Collection Test6.92.54.51.45.71.9
Inheritance Test15.63.912.94.514.24.2
Indexing Test23.26.212.43.817.85.0
Graph (Binary Tree) Test4.01.14.21.04.11.1
Multithreading Test27.46.222.75.825.06.0
All Tests16.14.111.43.513.73.8

The results above show that in general Hibernate with H2 embedded is much more efficient than EclipseLink with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of EclipseLink with Derby embedded database (3.8) to the normalized speed of Hibernate with H2 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 3.6 times faster than EclipseLink with Derby embedded.

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (6.2) to the normalized speed of Hibernate with H2 embedded database (27.4) reveals that in that case, Hibernate with H2 embedded is 4.4 times faster than EclipseLink with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test27.051.127.051.027.051.1
Element Collection Test30.638.530.639.430.638.9
Inheritance Test27.048.027.047.927.048.0
Indexing Test31.651.632.152.331.952.0
Graph (Binary Tree) Test28.513.421.411.725.012.6
Multithreading Test33.952.69.28.421.530.5
All Tests29.842.524.635.127.238.8

The results above show that in general EclipseLink with Derby embedded is more efficient than Hibernate with H2 embedded in using disk space.

On the other hand, EclipseLink with Derby embedded is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized score of EclipseLink with Derby embedded database (13.4) to the normalized score of Hibernate with H2 embedded database (28.5) reveals that in that case, EclipseLink with Derby embedded is 2.1 times less efficient than Hibernate with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Basic Person Test14.217.38.317.511.217.4
Element Collection Test7.211.34.45.45.88.3
Inheritance Test12.214.09.918.211.016.1
Indexing Test16.18.412.827.214.517.8
Graph (Binary Tree) Test7.02.27.72.67.32.4
Multithreading Test19.621.210.913.915.217.6
All Tests12.912.79.014.511.013.6

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

A large performance gap has been detected when using database indexes with large transaction/retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (12.8) to the normalized speed of EclipseLink with Derby embedded database (27.2) reveals that in that case, EclipseLink with Derby embedded is 2.1 times faster than Hibernate with H2 embedded.

On the other hand, EclipseLink with Derby embedded is slower, for instance, when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with Derby embedded database (2.2) to the normalized speed of Hibernate with H2 embedded database (7.0) reveals that in that case, EclipseLink with Derby embedded is 3.2 times slower than Hibernate with H2 embedded.

Other Head to Head DBMS/JPA Comparisons