Compare with

Comparison of Hibernate with MySQL server vs EclipseLink with Derby embedded

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
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test3.65.51.63.72.64.6
Element Collection Test1.63.00.721.71.12.4
Inheritance Test3.75.31.63.52.74.4
Indexing Test5.46.92.64.64.05.8
Graph (Binary Tree) Test1.52.01.21.91.41.9
Multithreading Test7.49.32.94.15.26.7
All Tests3.95.31.83.22.84.3

The results above show that in general EclipseLink with Derby embedded 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 JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.72) to the normalized speed of EclipseLink with Derby embedded database (1.7) reveals that in that case, EclipseLink with Derby embedded is 2.4 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
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test3.016.411.058.77.037.5
Element Collection Test0.347.51.213.30.7910.4
Inheritance Test1.317.114.558.97.938.0
Indexing Test2.514.212.867.47.640.8
Graph (Binary Tree) Test0.552.80.715.70.634.2
Multithreading Test0.2328.013.848.77.038.4
All Tests1.314.39.042.15.228.2

The results above show that in general EclipseLink with Derby 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 Derby embedded database (28.2) reveals that in these tests, EclipseLink with Derby embedded is 5.4 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 Derby embedded database (28.0) reveals that in that case, EclipseLink with Derby embedded is 122 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
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test10.053.42.013.86.033.6
Element Collection Test6.737.90.534.43.621.2
Inheritance Test2.837.41.615.02.226.2
Indexing Test0.447.62.049.31.228.4
Multithreading Test2.141.20.986.11.523.6
All Tests4.435.51.417.72.926.6

The results above show that in general EclipseLink with Derby embedded is much more efficient than Hibernate with MySQL server in executing the tested JPA queries. Comparing the normalized speed of Hibernate with MySQL database server (2.9) to the normalized speed of EclipseLink with Derby embedded database (26.6) reveals that in these tests, EclipseLink with Derby embedded is 9.2 times faster than Hibernate with MySQL server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test0.736.41.66.71.26.5
Element Collection Test0.395.41.26.20.785.8
Inheritance Test0.616.52.19.21.47.8
Indexing Test0.817.32.611.11.79.2
Graph (Binary Tree) Test0.692.80.401.70.542.2
Multithreading Test0.6321.33.05.01.813.1
All Tests0.648.31.86.61.27.5

The results above show that in general EclipseLink with Derby 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 Derby embedded database (7.5) reveals that in these tests, EclipseLink with Derby embedded is 6.2 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 Derby embedded database (21.3) reveals that in that case, EclipseLink with Derby embedded is 33.8 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
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test1.14.61.74.71.44.6
Element Collection Test0.212.50.531.40.371.9
Inheritance Test0.653.91.84.51.24.2
Indexing Test0.816.22.03.81.45.0
Graph (Binary Tree) Test0.551.10.621.00.581.1
Multithreading Test0.356.24.15.82.26.0
All Tests0.614.11.83.51.23.8

The results above show that in general EclipseLink with Derby 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 Derby embedded database (3.8) reveals that in these tests, EclipseLink with Derby embedded is 3.2 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 Derby embedded database (6.2) reveals that in that case, EclipseLink with Derby embedded is 17.7 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
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Hibernate
MySQL server
EclipseLink
Derby embedded
Basic Person Test3.717.33.617.53.617.4
Element Collection Test1.811.30.845.41.38.3
Inheritance Test1.814.04.318.23.116.1
Indexing Test2.08.44.427.23.217.8
Graph (Binary Tree) Test0.832.20.732.60.782.4
Multithreading Test2.121.25.013.93.617.6
All Tests2.112.73.214.52.713.6

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

A huge 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 Derby embedded database (21.2) reveals that in that case, EclipseLink with Derby embedded is 10.1 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons