Compare with

Comparison of Hibernate with Derby embedded 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 embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test5.925.13.88.94.917.0
Element Collection Test2.920.41.88.02.314.2
Inheritance Test5.328.73.78.74.518.7
Indexing Test7.037.64.814.05.925.8
Graph (Binary Tree) Test1.917.71.714.71.816.2
Multithreading Test10.530.33.711.47.120.8
All Tests5.626.63.310.94.418.8

The results above show that in general EclipseLink with H2 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 EclipseLink with H2 embedded database (18.8) reveals that in these tests, EclipseLink with H2 embedded is 4.3 times faster than Hibernate with Derby embedded.

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (1.9) to the normalized speed of EclipseLink with H2 embedded database (17.7) reveals that in that case, EclipseLink with H2 embedded is 9.3 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
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test14.230.416.429.115.329.7
Element Collection Test4.419.64.927.64.623.6
Inheritance Test10.333.818.639.814.436.8
Indexing Test10.022.216.441.313.231.8
Graph (Binary Tree) Test2.616.03.020.02.818.0
Multithreading Test19.333.719.329.019.331.4
All Tests10.125.913.131.111.628.5

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

A large performance gap has been detected 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 EclipseLink with H2 embedded database (20.0) reveals that in that case, EclipseLink with H2 embedded is 6.7 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
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test49.34.46.81.428.12.9
Element Collection Test37.64.12.72.420.13.2
Inheritance Test24.13.47.62.015.92.7
Indexing Test5.313.014.822.810.117.9
Multithreading Test39.71.06.10.6722.90.85
All Tests31.25.27.65.919.45.5

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

On the other hand, Hibernate with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (5.3) to the normalized speed of EclipseLink with H2 embedded database (13.0) reveals that in that case, Hibernate with Derby embedded is 2.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 embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test4.516.63.27.63.812.1
Element Collection Test3.915.33.110.53.512.9
Inheritance Test4.615.74.59.84.512.7
Indexing Test4.612.15.59.95.111.0
Graph (Binary Tree) Test2.713.71.27.02.010.3
Multithreading Test11.620.92.64.27.112.6
All Tests5.315.73.38.24.312.0

The results above show that in general EclipseLink with H2 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 EclipseLink with H2 embedded database (12.0) reveals that in these tests, EclipseLink with H2 embedded is 2.8 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.2) to the normalized speed of EclipseLink with H2 embedded database (7.0) reveals that in that case, EclipseLink with H2 embedded is 5.8 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
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test3.835.14.219.64.027.4
Element Collection Test2.319.31.58.51.913.9
Inheritance Test4.036.04.314.04.225.0
Indexing Test5.542.53.619.24.630.9
Graph (Binary Tree) Test0.7412.20.9614.40.8513.3
Multithreading Test5.654.44.925.85.340.1
All Tests3.733.33.316.93.525.1

The results above show that in general EclipseLink with H2 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 EclipseLink with H2 embedded database (25.1) reveals that in these tests, EclipseLink with H2 embedded is 7.2 times faster than Hibernate with Derby embedded.

A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (0.74) to the normalized speed of EclipseLink with H2 embedded database (12.2) reveals that in that case, EclipseLink with H2 embedded is 16.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
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test52.736.252.739.252.737.7
Element Collection Test42.333.342.334.942.334.1
Inheritance Test49.235.449.236.249.235.8
Indexing Test53.039.853.943.753.441.7
Graph (Binary Tree) Test13.141.09.828.411.534.7
Multithreading Test49.348.78.812.429.030.6
All Tests43.339.136.132.539.735.8

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Basic Person Test15.522.36.913.311.217.8
Element Collection Test10.215.72.811.46.513.6
Inheritance Test9.723.57.714.98.719.2
Indexing Test6.525.59.021.57.823.5
Graph (Binary Tree) Test2.014.91.714.01.814.5
Multithreading Test17.328.17.314.212.321.1
All Tests10.521.96.114.98.318.4

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

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 EclipseLink with H2 embedded database (14.0) reveals that in that case, EclipseLink with H2 embedded is 8.2 times faster than Hibernate with Derby embedded.

Other Head to Head DBMS/JPA Comparisons