Compare with

Comparison of Hibernate with MySQL server vs EclipseLink 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
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test3.65.61.62.52.64.0
Element Collection Test1.64.20.721.51.12.8
Inheritance Test3.76.61.62.12.74.4
Indexing Test5.49.72.64.14.06.9
Graph (Binary Tree) Test1.54.71.23.51.44.1
Multithreading Test7.410.22.94.05.27.1
All Tests3.96.81.82.92.84.9

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (1.5) to the normalized speed of EclipseLink with H2 database server (4.7) reveals that in that case, EclipseLink with H2 server is 3.1 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
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test3.05.511.08.27.06.8
Element Collection Test0.343.21.24.20.793.7
Inheritance Test1.34.714.510.17.97.4
Indexing Test2.54.412.89.47.66.9
Graph (Binary Tree) Test0.551.10.711.90.631.5
Multithreading Test0.2312.213.815.97.014.0
All Tests1.35.29.08.35.26.7

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

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 database server (12.2) reveals that in that case, EclipseLink with H2 server is 53.0 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
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test10.03.82.01.16.02.5
Element Collection Test6.74.10.531.13.62.6
Inheritance Test2.83.21.61.32.22.3
Indexing Test0.443.02.08.01.25.5
Multithreading Test2.11.10.981.01.51.1
All Tests4.43.01.42.52.92.8

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

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

On the other hand, Hibernate with MySQL server is slower, for instance, 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 database server (3.0) reveals that in that case, Hibernate with MySQL server is 6.8 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test0.734.51.62.21.23.4
Element Collection Test0.393.81.22.40.783.1
Inheritance Test0.614.42.13.01.43.7
Indexing Test0.814.22.63.11.73.7
Graph (Binary Tree) Test0.691.40.400.790.541.1
Multithreading Test0.637.83.02.51.85.1
All Tests0.644.31.82.31.23.3

The results above show that in general EclipseLink with H2 server is 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 database server (3.3) reveals that in these tests, EclipseLink with H2 server is 2.8 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.63) to the normalized speed of EclipseLink with H2 database server (7.8) reveals that in that case, EclipseLink with H2 server is 12.4 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
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test1.16.41.73.11.44.8
Element Collection Test0.213.00.531.30.372.2
Inheritance Test0.655.61.82.81.24.2
Indexing Test0.8110.32.03.81.47.0
Graph (Binary Tree) Test0.551.50.621.30.581.4
Multithreading Test0.357.04.14.92.26.0
All Tests0.615.61.82.91.24.3

The results above show that in general EclipseLink with H2 server 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 database server (4.3) reveals that in these tests, EclipseLink with H2 server is 3.6 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 database server (7.0) reveals that in that case, EclipseLink with H2 server is 20.0 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
 Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Hibernate
MySQL server
EclipseLink
H2 server
Basic Person Test3.75.23.63.43.64.3
Element Collection Test1.83.60.842.11.32.9
Inheritance Test1.84.94.33.93.14.4
Indexing Test2.06.34.45.73.26.0
Graph (Binary Tree) Test0.832.10.731.90.782.0
Multithreading Test2.17.75.05.73.66.7
All Tests2.15.13.23.82.74.5

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (2.1) to the normalized speed of EclipseLink with H2 database server (7.7) reveals that in that case, EclipseLink with H2 server is 3.7 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons