Compare with

Comparison of Hibernate with H2 server vs EclipseLink 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
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test4.65.53.03.73.84.6
Element Collection Test3.73.01.11.72.42.4
Inheritance Test6.75.33.13.54.94.4
Indexing Test8.26.94.24.66.25.8
Graph (Binary Tree) Test3.42.03.91.93.71.9
Multithreading Test6.89.35.04.15.96.7
All Tests5.65.33.43.24.54.3

The results above show that in general Hibernate with H2 server is slightly more efficient than EclipseLink with Derby embedded in persisting JPA entity objects to the database.

A large 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 database server (3.9) reveals that in that case, Hibernate with H2 server is 2.1 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
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test3.116.46.058.74.637.5
Element Collection Test1.07.51.113.31.010.4
Inheritance Test2.917.17.658.95.238.0
Indexing Test2.614.27.067.44.840.8
Graph (Binary Tree) Test0.422.81.15.70.784.2
Multithreading Test6.528.010.548.78.538.4
All Tests2.814.35.642.14.228.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test3.753.41.013.82.333.6
Element Collection Test3.737.90.634.42.221.2
Inheritance Test3.237.41.415.02.326.2
Indexing Test1.77.65.849.33.828.4
Multithreading Test1.141.20.886.11.023.6
All Tests2.735.51.917.72.326.6

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test2.96.41.86.72.46.5
Element Collection Test2.65.41.16.21.95.8
Inheritance Test3.26.52.59.22.97.8
Indexing Test2.97.32.711.12.89.2
Graph (Binary Tree) Test1.22.80.431.70.792.2
Multithreading Test5.621.32.45.04.013.1
All Tests3.18.31.86.62.57.5

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test3.84.62.44.73.14.6
Element Collection Test1.92.51.11.41.51.9
Inheritance Test3.73.92.54.53.14.2
Indexing Test7.66.23.13.85.35.0
Graph (Binary Tree) Test0.991.10.911.00.951.1
Multithreading Test6.16.27.35.86.76.0
All Tests4.04.12.93.53.53.8

The results above show that in general EclipseLink with Derby embedded is slightly more efficient than Hibernate with H2 server in deleting JPA entity objects from the database.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Basic Person Test3.617.32.817.53.217.4
Element Collection Test2.611.31.05.41.88.3
Inheritance Test4.014.03.418.23.716.1
Indexing Test4.68.44.527.24.617.8
Graph (Binary Tree) Test1.52.21.62.61.62.4
Multithreading Test5.221.25.213.95.217.6
All Tests3.712.73.214.53.413.6

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

A large performance gap has been detected when using simple basic entities with large transaction/retrieval size. Comparing the normalized speed of Hibernate with H2 database server (2.8) to the normalized speed of EclipseLink with Derby embedded database (17.5) reveals that in that case, EclipseLink with Derby embedded is 6.2 times faster than Hibernate with H2 server.

Other Head to Head DBMS/JPA Comparisons