Compare with

Comparison of EclipseLink with H2 embedded vs Hibernate with Derby server

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 server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test25.13.88.93.017.03.4
Element Collection Test20.42.08.01.314.21.7
Inheritance Test28.73.48.73.018.73.2
Indexing Test37.64.814.04.125.84.4
Graph (Binary Tree) Test17.71.814.71.616.21.7
Multithreading Test30.36.911.43.920.85.4
All Tests26.63.810.92.818.83.3

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
 EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test30.43.829.18.429.76.1
Element Collection Test19.61.027.61.023.61.0
Inheritance Test33.83.539.89.736.86.6
Indexing Test22.23.241.39.531.86.4
Graph (Binary Tree) Test16.00.9120.01.218.01.1
Multithreading Test33.77.829.013.431.410.6
All Tests25.93.431.17.228.55.3

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
 EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test4.434.01.44.12.919.1
Element Collection Test4.133.82.40.643.217.2
Inheritance Test3.420.52.05.02.712.8
Indexing Test13.02.022.89.217.95.6
Multithreading Test1.036.20.675.10.8520.6
All Tests5.225.35.94.85.515.1

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
 EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test16.62.97.62.512.12.7
Element Collection Test15.32.310.51.512.91.9
Inheritance Test15.72.99.83.512.73.2
Indexing Test12.13.09.94.211.03.6
Graph (Binary Tree) Test13.71.27.00.5810.30.91
Multithreading Test20.96.84.22.512.64.6
All Tests15.73.28.22.512.02.8

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
 EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test35.12.919.63.527.43.2
Element Collection Test19.31.78.50.8713.91.3
Inheritance Test36.02.914.03.625.03.2
Indexing Test42.53.719.23.630.93.7
Graph (Binary Tree) Test12.20.6914.40.7013.30.70
Multithreading Test54.46.225.85.140.15.6
All Tests33.33.016.92.925.13.0

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
 EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
EclipseLink
H2 embedded
Hibernate
Derby server
Basic Person Test22.39.513.34.317.86.9
Element Collection Test15.78.211.41.113.64.6
Inheritance Test23.56.614.95.019.25.8
Indexing Test25.53.321.56.123.54.7
Graph (Binary Tree) Test14.91.214.01.014.51.1
Multithreading Test28.112.814.26.021.19.4
All Tests21.97.114.94.018.45.6

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