Compare with

Comparison of Hibernate with Derby embedded vs EclipseLink 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
 Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test5.95.63.82.54.94.0
Element Collection Test2.94.21.81.52.32.8
Inheritance Test5.36.63.72.14.54.4
Indexing Test7.09.74.84.15.96.9
Graph (Binary Tree) Test1.94.71.73.51.84.1
Multithreading Test10.510.23.74.07.17.1
All Tests5.66.83.32.94.44.9

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

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 database server (4.7) reveals that in that case, EclipseLink with H2 server is 2.5 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 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test14.25.516.48.215.36.8
Element Collection Test4.43.24.94.24.63.7
Inheritance Test10.34.718.610.114.47.4
Indexing Test10.04.416.49.413.26.9
Graph (Binary Tree) Test2.61.13.01.92.81.5
Multithreading Test19.312.219.315.919.314.0
All Tests10.15.213.18.311.66.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test49.33.86.81.128.12.5
Element Collection Test37.64.12.71.120.12.6
Inheritance Test24.13.27.61.315.92.3
Indexing Test5.33.014.88.010.15.5
Multithreading Test39.71.16.11.022.91.1
All Tests31.23.07.62.519.42.8

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test4.54.53.22.23.83.4
Element Collection Test3.93.83.12.43.53.1
Inheritance Test4.64.44.53.04.53.7
Indexing Test4.64.25.53.15.13.7
Graph (Binary Tree) Test2.71.41.20.792.01.1
Multithreading Test11.67.82.62.57.15.1
All Tests5.34.33.32.34.33.3

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test3.86.44.23.14.04.8
Element Collection Test2.33.01.51.31.92.2
Inheritance Test4.05.64.32.84.24.2
Indexing Test5.510.33.63.84.67.0
Graph (Binary Tree) Test0.741.50.961.30.851.4
Multithreading Test5.67.04.94.95.36.0
All Tests3.75.63.32.93.54.3

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

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 (0.74) to the normalized speed of EclipseLink with H2 database server (1.5) reveals that in that case, EclipseLink with H2 server is 2.0 times faster than Hibernate with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Basic Person Test15.55.26.93.411.24.3
Element Collection Test10.23.62.82.16.52.9
Inheritance Test9.74.97.73.98.74.4
Indexing Test6.56.39.05.77.86.0
Graph (Binary Tree) Test2.02.11.71.91.82.0
Multithreading Test17.37.77.35.712.36.7
All Tests10.55.16.13.88.34.5

The results above show that in general Hibernate with Derby embedded is more efficient than EclipseLink with H2 server in performing JPA database operations.

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

Other Head to Head DBMS/JPA Comparisons