Compare with

Comparison of Hibernate with H2 server vs EclipseLink 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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test4.63.63.01.53.82.6
Element Collection Test3.71.51.10.692.41.1
Inheritance Test6.73.53.11.44.92.4
Indexing Test8.25.34.22.56.23.9
Graph (Binary Tree) Test3.41.73.91.33.71.5
Multithreading Test6.87.25.02.45.94.8
All Tests5.63.83.41.64.52.7

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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test3.10.436.015.54.68.0
Element Collection Test1.00.161.11.41.00.78
Inheritance Test2.90.397.617.65.29.0
Indexing Test2.60.437.016.64.88.5
Graph (Binary Tree) Test0.420.531.10.760.780.65
Multithreading Test6.50.1910.511.08.55.6
All Tests2.80.355.610.54.25.4

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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test3.71.51.00.442.30.95
Element Collection Test3.71.40.630.432.20.92
Inheritance Test3.21.11.40.612.30.86
Indexing Test1.70.265.80.523.80.39
Multithreading Test1.11.90.880.721.01.3
All Tests2.71.21.90.542.30.88

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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test2.90.391.81.82.41.1
Element Collection Test2.60.231.11.41.90.83
Inheritance Test3.20.422.52.62.91.5
Indexing Test2.90.462.73.12.81.8
Graph (Binary Tree) Test1.20.670.430.410.790.54
Multithreading Test5.60.482.42.64.01.5
All Tests3.10.441.82.02.51.2

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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test3.80.352.41.73.11.0
Element Collection Test1.90.111.10.511.50.31
Inheritance Test3.70.292.51.63.10.94
Indexing Test7.60.463.11.95.31.2
Graph (Binary Tree) Test0.990.540.910.490.950.51
Multithreading Test6.10.317.33.66.71.9
All Tests4.00.342.91.63.50.98

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
 Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Hibernate
H2 server
EclipseLink
MySQL server
Basic Person Test3.61.32.84.23.22.7
Element Collection Test2.60.691.00.891.80.79
Inheritance Test4.01.13.44.83.72.9
Indexing Test4.61.44.54.94.63.2
Graph (Binary Tree) Test1.50.851.60.731.60.79
Multithreading Test5.22.05.24.05.23.0
All Tests3.71.23.23.33.42.3

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