Compare with

Comparison of EclipseLink with Derby embedded vs Hibernate with H2 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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test5.518.13.79.04.613.5
Element Collection Test3.013.01.76.82.49.9
Inheritance Test5.321.03.59.44.415.2
Indexing Test6.929.94.618.45.824.1
Graph (Binary Tree) Test2.017.21.920.11.918.7
Multithreading Test9.336.94.111.56.724.2
All Tests5.322.63.212.54.317.6

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test16.416.658.713.337.515.0
Element Collection Test7.54.313.34.010.44.1
Inheritance Test17.110.458.917.538.013.9
Indexing Test14.210.867.415.240.813.0
Graph (Binary Tree) Test2.82.55.74.04.23.3
Multithreading Test28.016.248.715.738.415.9
All Tests14.310.142.111.628.210.9

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test53.44.513.81.233.62.8
Element Collection Test37.94.44.41.421.22.9
Inheritance Test37.43.115.01.526.22.3
Indexing Test7.66.649.310.528.48.6
Multithreading Test41.21.26.10.5923.60.89
All Tests35.54.017.73.026.63.5

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test6.412.16.76.56.59.3
Element Collection Test5.47.46.25.35.86.3
Inheritance Test6.510.89.28.57.89.6
Indexing Test7.310.011.17.59.28.8
Graph (Binary Tree) Test2.84.41.72.32.23.4
Multithreading Test21.316.25.04.013.110.1
All Tests8.310.16.65.77.57.9

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test4.619.74.711.44.615.5
Element Collection Test2.56.91.44.51.95.7
Inheritance Test3.915.64.512.94.214.2
Indexing Test6.223.23.812.45.017.8
Graph (Binary Tree) Test1.14.01.04.21.14.1
Multithreading Test6.227.45.822.76.025.0
All Tests4.116.13.511.43.813.7

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test51.127.051.027.051.127.0
Element Collection Test38.530.639.430.638.930.6
Inheritance Test48.027.047.927.048.027.0
Indexing Test51.631.652.332.152.031.9
Graph (Binary Tree) Test13.428.511.721.412.625.0
Multithreading Test52.633.98.49.230.521.5
All Tests42.529.835.124.638.827.2

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
 EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
EclipseLink
Derby embedded
Hibernate
H2 embedded
Basic Person Test17.314.217.58.317.411.2
Element Collection Test11.37.25.44.48.35.8
Inheritance Test14.012.218.29.916.111.0
Indexing Test8.416.127.212.817.814.5
Graph (Binary Tree) Test2.27.02.67.72.47.3
Multithreading Test21.219.613.910.917.615.2
All Tests12.712.914.59.013.611.0

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