Compare with

Comparison of EclipseLink with Derby server 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 server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test3.84.63.13.03.43.8
Element Collection Test2.23.71.51.11.82.4
Inheritance Test3.96.72.93.13.44.9
Indexing Test5.28.24.34.24.76.2
Graph (Binary Tree) Test1.93.41.73.91.83.7
Multithreading Test6.16.83.95.05.05.9
All Tests3.85.62.93.43.44.5

The results above show that in general Hibernate with H2 server is more efficient than EclipseLink with Derby server 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 database server (1.7) to the normalized speed of Hibernate with H2 database server (3.9) reveals that in that case, Hibernate with H2 server is 2.3 times faster than EclipseLink with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test6.43.111.36.08.84.6
Element Collection Test1.81.02.41.12.11.0
Inheritance Test3.72.912.97.68.35.2
Indexing Test3.62.612.87.08.24.8
Graph (Binary Tree) Test0.610.420.731.10.670.78
Multithreading Test8.56.519.810.514.18.5
All Tests4.12.810.05.67.04.2

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

A large 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 database server (2.4) reveals that in that case, EclipseLink with Derby server is 2.2 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 server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test45.83.75.31.025.62.3
Element Collection Test35.23.70.990.6318.12.2
Inheritance Test23.13.25.91.414.52.3
Indexing Test2.51.712.25.87.43.8
Multithreading Test34.31.17.70.8821.01.0
All Tests28.22.76.41.917.32.3

The results above show that in general EclipseLink with Derby server 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 database server (17.3) reveals that in these tests, EclipseLink with Derby server is 7.5 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 database server (34.3) reveals that in that case, EclipseLink with Derby server is 31.2 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 server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test3.92.94.41.84.12.4
Element Collection Test1.72.61.61.11.61.9
Inheritance Test4.63.26.12.55.32.9
Indexing Test4.52.97.62.76.12.8
Graph (Binary Tree) Test0.701.20.420.430.560.79
Multithreading Test7.35.64.82.46.04.0
All Tests3.83.14.21.84.02.5

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

A large performance gap has been detected when using database indexes with large transaction size. Comparing the normalized speed of Hibernate with H2 database server (2.7) to the normalized speed of EclipseLink with Derby database server (7.6) reveals that in that case, EclipseLink with Derby server is 2.8 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 server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test2.83.83.92.43.33.1
Element Collection Test1.21.90.551.10.871.5
Inheritance Test3.33.73.72.53.53.1
Indexing Test4.97.63.53.14.25.3
Graph (Binary Tree) Test0.510.990.500.910.510.95
Multithreading Test4.86.15.77.35.36.7
All Tests2.94.03.02.93.03.5

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
EclipseLink
Derby server
Hibernate
H2 server
Basic Person Test12.53.65.62.89.13.2
Element Collection Test8.42.61.41.04.91.8
Inheritance Test7.74.06.33.47.03.7
Indexing Test4.14.68.14.56.14.6
Graph (Binary Tree) Test0.931.50.831.60.881.6
Multithreading Test12.25.28.45.210.35.2
All Tests7.93.75.23.26.63.4

The results above show that in general EclipseLink with Derby server is more efficient than Hibernate 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 Hibernate with H2 database server (3.6) to the normalized speed of EclipseLink with Derby database server (12.5) reveals that in that case, EclipseLink with Derby server is 3.5 times faster than Hibernate with H2 server.

Other Head to Head DBMS/JPA Comparisons