Compare with

Comparison of Hibernate with H2 server vs EclipseLink with H2 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
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test4.625.13.08.93.817.0
Element Collection Test3.720.41.18.02.414.2
Inheritance Test6.728.73.18.74.918.7
Indexing Test8.237.64.214.06.225.8
Graph (Binary Tree) Test3.417.73.914.73.716.2
Multithreading Test6.830.35.011.45.920.8
All Tests5.626.63.410.94.518.8

The results above show that in general EclipseLink with H2 embedded is much more efficient than Hibernate with H2 server in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with H2 database server (4.5) to the normalized speed of EclipseLink with H2 embedded database (18.8) reveals that in these tests, EclipseLink with H2 embedded is 4.2 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 H2 embedded database (8.0) reveals that in that case, EclipseLink with H2 embedded is 7.3 times faster than Hibernate with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test3.130.46.029.14.629.7
Element Collection Test1.019.61.127.61.023.6
Inheritance Test2.933.87.639.85.236.8
Indexing Test2.622.27.041.34.831.8
Graph (Binary Tree) Test0.4216.01.120.00.7818.0
Multithreading Test6.533.710.529.08.531.4
All Tests2.825.95.631.14.228.5

The results above show that in general EclipseLink with H2 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 H2 embedded database (28.5) reveals that in these tests, EclipseLink with H2 embedded is 6.8 times faster than Hibernate with H2 server.

A huge performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (0.42) to the normalized speed of EclipseLink with H2 embedded database (16.0) reveals that in that case, EclipseLink with H2 embedded is 38.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
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test3.74.41.01.42.32.9
Element Collection Test3.74.10.632.42.23.2
Inheritance Test3.23.41.42.02.32.7
Indexing Test1.713.05.822.83.817.9
Multithreading Test1.11.00.880.671.00.85
All Tests2.75.21.95.92.35.5

The results above show that in general EclipseLink with H2 embedded is 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 H2 embedded database (5.5) reveals that in these tests, EclipseLink with H2 embedded is 2.4 times faster than Hibernate with H2 server.

A large performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.7) to the normalized speed of EclipseLink with H2 embedded database (13.0) reveals that in that case, EclipseLink with H2 embedded is 7.6 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
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test2.916.61.87.62.412.1
Element Collection Test2.615.31.110.51.912.9
Inheritance Test3.215.72.59.82.912.7
Indexing Test2.912.12.79.92.811.0
Graph (Binary Tree) Test1.213.70.437.00.7910.3
Multithreading Test5.620.92.44.24.012.6
All Tests3.115.71.88.22.512.0

The results above show that in general EclipseLink with H2 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 H2 embedded database (12.0) reveals that in these tests, EclipseLink with H2 embedded is 4.8 times faster than Hibernate with H2 server.

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with H2 database server (0.43) to the normalized speed of EclipseLink with H2 embedded database (7.0) reveals that in that case, EclipseLink with H2 embedded is 16.3 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
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test3.835.12.419.63.127.4
Element Collection Test1.919.31.18.51.513.9
Inheritance Test3.736.02.514.03.125.0
Indexing Test7.642.53.119.25.330.9
Graph (Binary Tree) Test0.9912.20.9114.40.9513.3
Multithreading Test6.154.47.325.86.740.1
All Tests4.033.32.916.93.525.1

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with H2 database server (0.91) to the normalized speed of EclipseLink with H2 embedded database (14.4) reveals that in that case, EclipseLink with H2 embedded is 15.8 times faster than Hibernate with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Hibernate
H2 server
EclipseLink
H2 embedded
Basic Person Test3.622.32.813.33.217.8
Element Collection Test2.615.71.011.41.813.6
Inheritance Test4.023.53.414.93.719.2
Indexing Test4.625.54.521.54.623.5
Graph (Binary Tree) Test1.514.91.614.01.614.5
Multithreading Test5.228.15.214.25.221.1
All Tests3.721.93.214.93.418.4

The results above show that in general EclipseLink with H2 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 H2 embedded database (18.4) reveals that in these tests, EclipseLink with H2 embedded is 5.4 times faster than Hibernate with H2 server.

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

Other Head to Head DBMS/JPA Comparisons