Compare with

Comparison of Hibernate with Derby server 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
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test3.83.63.01.53.42.6
Element Collection Test2.01.51.30.691.71.1
Inheritance Test3.43.53.01.43.22.4
Indexing Test4.85.34.12.54.43.9
Graph (Binary Tree) Test1.81.71.61.31.71.5
Multithreading Test6.97.23.92.45.44.8
All Tests3.83.82.81.63.32.7

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
 Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test3.80.438.415.56.18.0
Element Collection Test1.00.161.01.41.00.78
Inheritance Test3.50.399.717.66.69.0
Indexing Test3.20.439.516.66.48.5
Graph (Binary Tree) Test0.910.531.20.761.10.65
Multithreading Test7.80.1913.411.010.65.6
All Tests3.40.357.210.55.35.4

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
 Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test34.01.54.10.4419.10.95
Element Collection Test33.81.40.640.4317.20.92
Inheritance Test20.51.15.00.6112.80.86
Indexing Test2.00.269.20.525.60.39
Multithreading Test36.21.95.10.7220.61.3
All Tests25.31.24.80.5415.10.88

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
 Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test2.90.392.51.82.71.1
Element Collection Test2.30.231.51.41.90.83
Inheritance Test2.90.423.52.63.21.5
Indexing Test3.00.464.23.13.61.8
Graph (Binary Tree) Test1.20.670.580.410.910.54
Multithreading Test6.80.482.52.64.61.5
All Tests3.20.442.52.02.81.2

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
 Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test2.90.353.51.73.21.0
Element Collection Test1.70.110.870.511.30.31
Inheritance Test2.90.293.61.63.20.94
Indexing Test3.70.463.61.93.71.2
Graph (Binary Tree) Test0.690.540.700.490.700.51
Multithreading Test6.20.315.13.65.61.9
All Tests3.00.342.91.63.00.98

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
 Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Hibernate
Derby server
EclipseLink
MySQL server
Basic Person Test9.51.34.34.26.92.7
Element Collection Test8.20.691.10.894.60.79
Inheritance Test6.61.15.04.85.82.9
Indexing Test3.31.46.14.94.73.2
Graph (Binary Tree) Test1.20.851.00.731.10.79
Multithreading Test12.82.06.04.09.43.0
All Tests7.11.24.03.35.62.3

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