Compare with

Comparison of EclipseLink with Derby embedded vs Hibernate with H2 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
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test5.54.63.73.04.63.8
Element Collection Test3.03.71.71.12.42.4
Inheritance Test5.36.73.53.14.44.9
Indexing Test6.98.24.64.25.86.2
Graph (Binary Tree) Test2.03.41.93.91.93.7
Multithreading Test9.36.84.15.06.75.9
All Tests5.35.63.23.44.34.5

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
 EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test16.43.158.76.037.54.6
Element Collection Test7.51.013.31.110.41.0
Inheritance Test17.12.958.97.638.05.2
Indexing Test14.22.667.47.040.84.8
Graph (Binary Tree) Test2.80.425.71.14.20.78
Multithreading Test28.06.548.710.538.48.5
All Tests14.32.842.15.628.24.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
 EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test53.43.713.81.033.62.3
Element Collection Test37.93.74.40.6321.22.2
Inheritance Test37.43.215.01.426.22.3
Indexing Test7.61.749.35.828.43.8
Multithreading Test41.21.16.10.8823.61.0
All Tests35.52.717.71.926.62.3

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
 EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test6.42.96.71.86.52.4
Element Collection Test5.42.66.21.15.81.9
Inheritance Test6.53.29.22.57.82.9
Indexing Test7.32.911.12.79.22.8
Graph (Binary Tree) Test2.81.21.70.432.20.79
Multithreading Test21.35.65.02.413.14.0
All Tests8.33.16.61.87.52.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
 EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test4.63.84.72.44.63.1
Element Collection Test2.51.91.41.11.91.5
Inheritance Test3.93.74.52.54.23.1
Indexing Test6.27.63.83.15.05.3
Graph (Binary Tree) Test1.10.991.00.911.10.95
Multithreading Test6.26.15.87.36.06.7
All Tests4.14.03.52.93.83.5

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
 EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
EclipseLink
Derby embedded
Hibernate
H2 server
Basic Person Test17.33.617.52.817.43.2
Element Collection Test11.32.65.41.08.31.8
Inheritance Test14.04.018.23.416.13.7
Indexing Test8.44.627.24.517.84.6
Graph (Binary Tree) Test2.21.52.61.62.41.6
Multithreading Test21.25.213.95.217.65.2
All Tests12.73.714.53.213.63.4

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