Compare with

Comparison of Hibernate with H2 embedded 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 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test18.13.69.01.513.52.6
Element Collection Test13.01.56.80.699.91.1
Inheritance Test21.03.59.41.415.22.4
Indexing Test29.95.318.42.524.13.9
Graph (Binary Tree) Test17.21.720.11.318.71.5
Multithreading Test36.97.211.52.424.24.8
All Tests22.63.812.51.617.62.7

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

A huge 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 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 15.5 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 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test16.60.4313.315.515.08.0
Element Collection Test4.30.164.01.44.10.78
Inheritance Test10.40.3917.517.613.99.0
Indexing Test10.80.4315.216.613.08.5
Graph (Binary Tree) Test2.50.534.00.763.30.65
Multithreading Test16.20.1915.711.015.95.6
All Tests10.10.3511.610.510.95.4

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

A huge performance gap has been detected 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 embedded database (16.2) reveals that in that case, Hibernate with H2 embedded is 85.3 times faster than EclipseLink with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test4.51.51.20.442.80.95
Element Collection Test4.41.41.40.432.90.92
Inheritance Test3.11.11.50.612.30.86
Indexing Test6.60.2610.50.528.60.39
Multithreading Test1.21.90.590.720.891.3
All Tests4.01.23.00.543.50.88

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (0.26) to the normalized speed of Hibernate with H2 embedded database (6.6) reveals that in that case, Hibernate with H2 embedded is 25.4 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 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test12.10.396.51.89.31.1
Element Collection Test7.40.235.31.46.30.83
Inheritance Test10.80.428.52.69.61.5
Indexing Test10.00.467.53.18.81.8
Graph (Binary Tree) Test4.40.672.30.413.40.54
Multithreading Test16.20.484.02.610.11.5
All Tests10.10.445.72.07.91.2

The results above show that in general Hibernate with H2 embedded is much 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 embedded database (7.9) reveals that in these tests, Hibernate with H2 embedded is 6.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.48) to the normalized speed of Hibernate with H2 embedded database (16.2) reveals that in that case, Hibernate with H2 embedded is 33.8 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 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test19.70.3511.41.715.51.0
Element Collection Test6.90.114.50.515.70.31
Inheritance Test15.60.2912.91.614.20.94
Indexing Test23.20.4612.41.917.81.2
Graph (Binary Tree) Test4.00.544.20.494.10.51
Multithreading Test27.40.3122.73.625.01.9
All Tests16.10.3411.41.613.70.98

The results above show that in general Hibernate with H2 embedded 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 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 14.0 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 embedded database (27.4) reveals that in that case, Hibernate with H2 embedded is 88.4 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 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Hibernate
H2 embedded
EclipseLink
MySQL server
Basic Person Test14.21.38.34.211.22.7
Element Collection Test7.20.694.40.895.80.79
Inheritance Test12.21.19.94.811.02.9
Indexing Test16.11.412.84.914.53.2
Graph (Binary Tree) Test7.00.857.70.737.30.79
Multithreading Test19.62.010.94.015.23.0
All Tests12.91.29.03.311.02.3

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

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

Other Head to Head DBMS/JPA Comparisons