Compare with

Comparison of EclipseLink with MySQL server vs Hibernate with Derby 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
 EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test3.63.81.53.02.63.4
Element Collection Test1.52.00.691.31.11.7
Inheritance Test3.53.41.43.02.43.2
Indexing Test5.34.82.54.13.94.4
Graph (Binary Tree) Test1.71.81.31.61.51.7
Multithreading Test7.26.92.43.94.85.4
All Tests3.83.81.62.82.73.3

The results above show that in general Hibernate with Derby server is slightly 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 database server (3.0) reveals that in that case, Hibernate with Derby server is 2.1 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 server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test0.433.815.58.48.06.1
Element Collection Test0.161.01.41.00.781.0
Inheritance Test0.393.517.69.79.06.6
Indexing Test0.433.216.69.58.56.4
Graph (Binary Tree) Test0.530.910.761.20.651.1
Multithreading Test0.197.811.013.45.610.6
All Tests0.353.410.57.25.45.3

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

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 Derby database server (7.8) reveals that in that case, EclipseLink with MySQL server is 41.1 times slower than Hibernate with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test1.534.00.444.10.9519.1
Element Collection Test1.433.80.430.640.9217.2
Inheritance Test1.120.50.615.00.8612.8
Indexing Test0.262.00.529.20.395.6
Multithreading Test1.936.20.725.11.320.6
All Tests1.225.30.544.80.8815.1

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (1.4) to the normalized speed of Hibernate with Derby database server (33.8) reveals that in that case, Hibernate with Derby server is 24.1 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 server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test0.392.91.82.51.12.7
Element Collection Test0.232.31.41.50.831.9
Inheritance Test0.422.92.63.51.53.2
Indexing Test0.463.03.14.21.83.6
Graph (Binary Tree) Test0.671.20.410.580.540.91
Multithreading Test0.486.82.62.51.54.6
All Tests0.443.22.02.51.22.8

The results above show that in general Hibernate with Derby 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 Derby database server (2.8) reveals that in these tests, Hibernate with Derby server is 2.3 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 database server (6.8) reveals that in that case, Hibernate with Derby server is 14.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 server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test0.352.91.73.51.03.2
Element Collection Test0.111.70.510.870.311.3
Inheritance Test0.292.91.63.60.943.2
Indexing Test0.463.71.93.61.23.7
Graph (Binary Tree) Test0.540.690.490.700.510.70
Multithreading Test0.316.23.65.11.95.6
All Tests0.343.01.62.90.983.0

The results above show that in general Hibernate with Derby 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 Derby database server (3.0) reveals that in these tests, Hibernate with Derby server is 3.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.31) to the normalized speed of Hibernate with Derby database server (6.2) reveals that in that case, Hibernate with Derby server is 20.0 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 server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
Basic Person Test1.39.54.24.32.76.9
Element Collection Test0.698.20.891.10.794.6
Inheritance Test1.16.64.85.02.95.8
Indexing Test1.43.34.96.13.24.7
Graph (Binary Tree) Test0.851.20.731.00.791.1
Multithreading Test2.012.84.06.03.09.4
All Tests1.27.13.34.02.35.6

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

Other Head to Head DBMS/JPA Comparisons