Compare with

Comparison of Hibernate with Derby server vs EclipseLink 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
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test3.825.13.08.93.417.0
Element Collection Test2.020.41.38.01.714.2
Inheritance Test3.428.73.08.73.218.7
Indexing Test4.837.64.114.04.425.8
Graph (Binary Tree) Test1.817.71.614.71.716.2
Multithreading Test6.930.33.911.45.420.8
All Tests3.826.62.810.93.318.8

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.0) to the normalized speed of EclipseLink with H2 embedded database (20.4) reveals that in that case, EclipseLink with H2 embedded is 10.2 times faster than Hibernate with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test3.830.48.429.16.129.7
Element Collection Test1.019.61.027.61.023.6
Inheritance Test3.533.89.739.86.636.8
Indexing Test3.222.29.541.36.431.8
Graph (Binary Tree) Test0.9116.01.220.01.118.0
Multithreading Test7.833.713.429.010.631.4
All Tests3.425.97.231.15.328.5

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

A huge performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with Derby database server (1.0) to the normalized speed of EclipseLink with H2 embedded database (27.6) reveals that in that case, EclipseLink with H2 embedded is 27.6 times faster than Hibernate with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test34.04.44.11.419.12.9
Element Collection Test33.84.10.642.417.23.2
Inheritance Test20.53.45.02.012.82.7
Indexing Test2.013.09.222.85.617.9
Multithreading Test36.21.05.10.6720.60.85
All Tests25.35.24.85.915.15.5

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

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

On the other hand, Hibernate with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby database server (2.0) to the normalized speed of EclipseLink with H2 embedded database (13.0) reveals that in that case, Hibernate with Derby server is 6.5 times slower than EclipseLink with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test2.916.62.57.62.712.1
Element Collection Test2.315.31.510.51.912.9
Inheritance Test2.915.73.59.83.212.7
Indexing Test3.012.14.29.93.611.0
Graph (Binary Tree) Test1.213.70.587.00.9110.3
Multithreading Test6.820.92.54.24.612.6
All Tests3.215.72.58.22.812.0

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test2.935.13.519.63.227.4
Element Collection Test1.719.30.878.51.313.9
Inheritance Test2.936.03.614.03.225.0
Indexing Test3.742.53.619.23.730.9
Graph (Binary Tree) Test0.6912.20.7014.40.7013.3
Multithreading Test6.254.45.125.85.640.1
All Tests3.033.32.916.93.025.1

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Basic Person Test9.522.34.313.36.917.8
Element Collection Test8.215.71.111.44.613.6
Inheritance Test6.623.55.014.95.819.2
Indexing Test3.325.56.121.54.723.5
Graph (Binary Tree) Test1.214.91.014.01.114.5
Multithreading Test12.828.16.014.29.421.1
All Tests7.121.94.014.95.618.4

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

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

Other Head to Head DBMS/JPA Comparisons