Compare with

Comparison of EclipseLink with MySQL server vs Hibernate 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
 EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test3.65.91.53.82.64.9
Element Collection Test1.52.90.691.81.12.3
Inheritance Test3.55.31.43.72.44.5
Indexing Test5.37.02.54.83.95.9
Graph (Binary Tree) Test1.71.91.31.71.51.8
Multithreading Test7.210.52.43.74.87.1
All Tests3.85.61.63.32.74.4

The results above show that in general Hibernate with Derby embedded 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 class inheritance in the object model with large transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (1.4) to the normalized speed of Hibernate with Derby embedded database (3.7) reveals that in that case, Hibernate with Derby embedded is 2.6 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
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test0.4314.215.516.48.015.3
Element Collection Test0.164.41.44.90.784.6
Inheritance Test0.3910.317.618.69.014.4
Indexing Test0.4310.016.616.48.513.2
Graph (Binary Tree) Test0.532.60.763.00.652.8
Multithreading Test0.1919.311.019.35.619.3
All Tests0.3510.110.513.15.411.6

The results above show that in general Hibernate with Derby 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 Derby embedded database (11.6) reveals that in these tests, Hibernate with Derby embedded is 2.1 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 Derby embedded database (19.3) reveals that in that case, Hibernate with Derby embedded is 102 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
 EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test1.549.30.446.80.9528.1
Element Collection Test1.437.60.432.70.9220.1
Inheritance Test1.124.10.617.60.8615.9
Indexing Test0.265.30.5214.80.3910.1
Multithreading Test1.939.70.726.11.322.9
All Tests1.231.20.547.60.8819.4

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

A huge performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (1.5) to the normalized speed of Hibernate with Derby embedded database (49.3) reveals that in that case, Hibernate with Derby embedded is 32.9 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
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test0.394.51.83.21.13.8
Element Collection Test0.233.91.43.10.833.5
Inheritance Test0.424.62.64.51.54.5
Indexing Test0.464.63.15.51.85.1
Graph (Binary Tree) Test0.672.70.411.20.542.0
Multithreading Test0.4811.62.62.61.57.1
All Tests0.445.32.03.31.24.3

The results above show that in general Hibernate with Derby 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 Derby embedded database (4.3) reveals that in these tests, Hibernate with Derby embedded 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.48) to the normalized speed of Hibernate with Derby embedded database (11.6) reveals that in that case, Hibernate with Derby embedded is 24.2 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
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test0.353.81.74.21.04.0
Element Collection Test0.112.30.511.50.311.9
Inheritance Test0.294.01.64.30.944.2
Indexing Test0.465.51.93.61.24.6
Graph (Binary Tree) Test0.540.740.490.960.510.85
Multithreading Test0.315.63.64.91.95.3
All Tests0.343.71.63.30.983.5

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (0.11) to the normalized speed of Hibernate with Derby embedded database (2.3) reveals that in that case, Hibernate with Derby embedded is 20.9 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
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
EclipseLink
MySQL server
Hibernate
Derby embedded
Basic Person Test1.315.54.26.92.711.2
Element Collection Test0.6910.20.892.80.796.5
Inheritance Test1.19.74.87.72.98.7
Indexing Test1.46.54.99.03.27.8
Graph (Binary Tree) Test0.852.00.731.70.791.8
Multithreading Test2.017.34.07.33.012.3
All Tests1.210.53.36.12.38.3

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

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

Other Head to Head DBMS/JPA Comparisons