Compare with

Comparison of EclipseLink with H2 server 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 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test5.65.92.53.84.04.9
Element Collection Test4.22.91.51.82.82.3
Inheritance Test6.65.32.13.74.44.5
Indexing Test9.77.04.14.86.95.9
Graph (Binary Tree) Test4.71.93.51.74.11.8
Multithreading Test10.210.54.03.77.17.1
All Tests6.85.62.93.34.94.4

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
 EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test5.514.28.216.46.815.3
Element Collection Test3.24.44.24.93.74.6
Inheritance Test4.710.310.118.67.414.4
Indexing Test4.410.09.416.46.913.2
Graph (Binary Tree) Test1.12.61.93.01.52.8
Multithreading Test12.219.315.919.314.019.3
All Tests5.210.18.313.16.711.6

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
 EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test3.849.31.16.82.528.1
Element Collection Test4.137.61.12.72.620.1
Inheritance Test3.224.11.37.62.315.9
Indexing Test3.05.38.014.85.510.1
Multithreading Test1.139.71.06.11.122.9
All Tests3.031.22.57.62.819.4

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
 EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test4.54.52.23.23.43.8
Element Collection Test3.83.92.43.13.13.5
Inheritance Test4.44.63.04.53.74.5
Indexing Test4.24.63.15.53.75.1
Graph (Binary Tree) Test1.42.70.791.21.12.0
Multithreading Test7.811.62.52.65.17.1
All Tests4.35.32.33.33.34.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
 EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test6.43.83.14.24.84.0
Element Collection Test3.02.31.31.52.21.9
Inheritance Test5.64.02.84.34.24.2
Indexing Test10.35.53.83.67.04.6
Graph (Binary Tree) Test1.50.741.30.961.40.85
Multithreading Test7.05.64.94.96.05.3
All Tests5.63.72.93.34.33.5

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
 EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
EclipseLink
H2 server
Hibernate
Derby embedded
Basic Person Test5.215.53.46.94.311.2
Element Collection Test3.610.22.12.82.96.5
Inheritance Test4.99.73.97.74.48.7
Indexing Test6.36.55.79.06.07.8
Graph (Binary Tree) Test2.12.01.91.72.01.8
Multithreading Test7.717.35.77.36.712.3
All Tests5.110.53.86.14.58.3

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