Compare with

Comparison of EclipseLink with MySQL 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
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test3.64.61.53.02.63.8
Element Collection Test1.53.70.691.11.12.4
Inheritance Test3.56.71.43.12.44.9
Indexing Test5.38.22.54.23.96.2
Graph (Binary Tree) Test1.73.41.33.91.53.7
Multithreading Test7.26.82.45.04.85.9
All Tests3.85.61.63.42.74.5

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test0.433.115.56.08.04.6
Element Collection Test0.161.01.41.10.781.0
Inheritance Test0.392.917.67.69.05.2
Indexing Test0.432.616.67.08.54.8
Graph (Binary Tree) Test0.530.420.761.10.650.78
Multithreading Test0.196.511.010.55.68.5
All Tests0.352.810.55.65.44.2

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

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

On the other hand, EclipseLink with MySQL server is slower, for instance, when using multithreading with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (0.19) to the normalized speed of Hibernate with H2 database server (6.5) reveals that in that case, EclipseLink with MySQL server is 34.2 times slower than Hibernate with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test1.53.70.441.00.952.3
Element Collection Test1.43.70.430.630.922.2
Inheritance Test1.13.20.611.40.862.3
Indexing Test0.261.70.525.80.393.8
Multithreading Test1.91.10.720.881.31.0
All Tests1.22.70.541.90.882.3

The results above show that in general Hibernate with H2 server is more efficient than EclipseLink with MySQL server in executing the tested JPA queries. Comparing the normalized speed of EclipseLink with MySQL database server (0.88) to the normalized speed of Hibernate with H2 database server (2.3) reveals that in these tests, Hibernate with H2 server is 2.6 times faster than EclipseLink with MySQL server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test0.392.91.81.81.12.4
Element Collection Test0.232.61.41.10.831.9
Inheritance Test0.423.22.62.51.52.9
Indexing Test0.462.93.12.71.82.8
Graph (Binary Tree) Test0.671.20.410.430.540.79
Multithreading Test0.485.62.62.41.54.0
All Tests0.443.12.01.81.22.5

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test0.353.81.72.41.03.1
Element Collection Test0.111.90.511.10.311.5
Inheritance Test0.293.71.62.50.943.1
Indexing Test0.467.61.93.11.25.3
Graph (Binary Tree) Test0.540.990.490.910.510.95
Multithreading Test0.316.13.67.31.96.7
All Tests0.344.01.62.90.983.5

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
Basic Person Test1.33.64.22.82.73.2
Element Collection Test0.692.60.891.00.791.8
Inheritance Test1.14.04.83.42.93.7
Indexing Test1.44.64.94.53.24.6
Graph (Binary Tree) Test0.851.50.731.60.791.6
Multithreading Test2.05.24.05.23.05.2
All Tests1.23.73.33.22.33.4

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

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

Other Head to Head DBMS/JPA Comparisons