Compare with

Comparison of EclipseLink with H2 embedded vs Hibernate with MySQL 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
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test25.13.68.91.617.02.6
Element Collection Test20.41.68.00.7214.21.1
Inheritance Test28.73.78.71.618.72.7
Indexing Test37.65.414.02.625.84.0
Graph (Binary Tree) Test17.71.514.71.216.21.4
Multithreading Test30.37.411.42.920.85.2
All Tests26.63.910.91.818.82.8

The results above show that in general EclipseLink with H2 embedded is much more efficient than Hibernate with MySQL server in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with MySQL database server (2.8) to the normalized speed of EclipseLink with H2 embedded database (18.8) reveals that in these tests, EclipseLink with H2 embedded is 6.7 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (1.6) to the normalized speed of EclipseLink with H2 embedded database (20.4) reveals that in that case, EclipseLink with H2 embedded is 12.7 times faster than Hibernate with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test30.43.029.111.029.77.0
Element Collection Test19.60.3427.61.223.60.79
Inheritance Test33.81.339.814.536.87.9
Indexing Test22.22.541.312.831.87.6
Graph (Binary Tree) Test16.00.5520.00.7118.00.63
Multithreading Test33.70.2329.013.831.47.0
All Tests25.91.331.19.028.55.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test4.410.01.42.02.96.0
Element Collection Test4.16.72.40.533.23.6
Inheritance Test3.42.82.01.62.72.2
Indexing Test13.00.4422.82.017.91.2
Multithreading Test1.02.10.670.980.851.5
All Tests5.24.45.91.45.52.9

The results above show that in general EclipseLink with H2 embedded is more efficient than Hibernate with MySQL server in executing the tested JPA queries.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.44) to the normalized speed of EclipseLink with H2 embedded database (13.0) reveals that in that case, EclipseLink with H2 embedded is 29.5 times faster than Hibernate with MySQL server.

On the other hand, EclipseLink with H2 embedded is slower, for instance, when using simple basic entities with small retrieval size. Comparing the normalized speed of EclipseLink with H2 embedded database (4.4) to the normalized speed of Hibernate with MySQL database server (10.0) reveals that in that case, EclipseLink with H2 embedded is 2.3 times slower than Hibernate with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test16.60.737.61.612.11.2
Element Collection Test15.30.3910.51.212.90.78
Inheritance Test15.70.619.82.112.71.4
Indexing Test12.10.819.92.611.01.7
Graph (Binary Tree) Test13.70.697.00.4010.30.54
Multithreading Test20.90.634.23.012.61.8
All Tests15.70.648.21.812.01.2

The results above show that in general EclipseLink with H2 embedded is much more efficient than Hibernate with MySQL server in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with MySQL database server (1.2) to the normalized speed of EclipseLink with H2 embedded database (12.0) reveals that in these tests, EclipseLink with H2 embedded is 10.0 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.39) to the normalized speed of EclipseLink with H2 embedded database (15.3) reveals that in that case, EclipseLink with H2 embedded is 39.2 times faster than Hibernate with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test35.11.119.61.727.41.4
Element Collection Test19.30.218.50.5313.90.37
Inheritance Test36.00.6514.01.825.01.2
Indexing Test42.50.8119.22.030.91.4
Graph (Binary Tree) Test12.20.5514.40.6213.30.58
Multithreading Test54.40.3525.84.140.12.2
All Tests33.30.6116.91.825.11.2

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.35) to the normalized speed of EclipseLink with H2 embedded database (54.4) reveals that in that case, EclipseLink with H2 embedded is 155 times faster than Hibernate with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
EclipseLink
H2 embedded
Hibernate
MySQL server
Basic Person Test22.33.713.33.617.83.6
Element Collection Test15.71.811.40.8413.61.3
Inheritance Test23.51.814.94.319.23.1
Indexing Test25.52.021.54.423.53.2
Graph (Binary Tree) Test14.90.8314.00.7314.50.78
Multithreading Test28.12.114.25.021.13.6
All Tests21.92.114.93.218.42.7

The results above show that in general EclipseLink with H2 embedded is much more efficient than Hibernate with MySQL server in performing JPA database operations. Comparing the normalized speed of Hibernate with MySQL database server (2.7) to the normalized speed of EclipseLink with H2 embedded database (18.4) reveals that in these tests, EclipseLink with H2 embedded is 6.8 times faster than Hibernate with MySQL server.

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

Other Head to Head DBMS/JPA Comparisons