Compare with

Comparison of EclipseLink with H2 embedded vs Hibernate 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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test25.15.98.93.817.04.9
Element Collection Test20.42.98.01.814.22.3
Inheritance Test28.75.38.73.718.74.5
Indexing Test37.67.014.04.825.85.9
Graph (Binary Tree) Test17.71.914.71.716.21.8
Multithreading Test30.310.511.43.720.87.1
All Tests26.65.610.93.318.84.4

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test30.414.229.116.429.715.3
Element Collection Test19.64.427.64.923.64.6
Inheritance Test33.810.339.818.636.814.4
Indexing Test22.210.041.316.431.813.2
Graph (Binary Tree) Test16.02.620.03.018.02.8
Multithreading Test33.719.329.019.331.419.3
All Tests25.910.131.113.128.511.6

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test4.449.31.46.82.928.1
Element Collection Test4.137.62.42.73.220.1
Inheritance Test3.424.12.07.62.715.9
Indexing Test13.05.322.814.817.910.1
Multithreading Test1.039.70.676.10.8522.9
All Tests5.231.25.97.65.519.4

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test16.64.57.63.212.13.8
Element Collection Test15.33.910.53.112.93.5
Inheritance Test15.74.69.84.512.74.5
Indexing Test12.14.69.95.511.05.1
Graph (Binary Tree) Test13.72.77.01.210.32.0
Multithreading Test20.911.64.22.612.67.1
All Tests15.75.38.23.312.04.3

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test35.13.819.64.227.44.0
Element Collection Test19.32.38.51.513.91.9
Inheritance Test36.04.014.04.325.04.2
Indexing Test42.55.519.23.630.94.6
Graph (Binary Tree) Test12.20.7414.40.9613.30.85
Multithreading Test54.45.625.84.940.15.3
All Tests33.33.716.93.325.13.5

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test36.252.739.252.737.752.7
Element Collection Test33.342.334.942.334.142.3
Inheritance Test35.449.236.249.235.849.2
Indexing Test39.853.043.753.941.753.4
Graph (Binary Tree) Test41.013.128.49.834.711.5
Multithreading Test48.749.312.48.830.629.0
All Tests39.143.332.536.135.839.7

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
 EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
EclipseLink
H2 embedded
Hibernate
Derby embedded
Basic Person Test22.315.513.36.917.811.2
Element Collection Test15.710.211.42.813.66.5
Inheritance Test23.59.714.97.719.28.7
Indexing Test25.56.521.59.023.57.8
Graph (Binary Tree) Test14.92.014.01.714.51.8
Multithreading Test28.117.314.27.321.112.3
All Tests21.910.514.96.118.48.3

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