Compare with

Comparison of EclipseLink with MySQL server vs Hibernate with PostgreSQL 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test3.67.11.53.42.65.2
Element Collection Test1.52.90.691.71.12.3
Inheritance Test3.57.01.43.62.45.3
Indexing Test5.39.32.56.13.97.7
Graph (Binary Tree) Test1.73.01.32.91.52.9
Multithreading Test7.231.72.413.94.822.8
All Tests3.810.21.65.32.77.7

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

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of EclipseLink with MySQL database server (2.4) to the normalized speed of Hibernate with PostgreSQL database server (13.9) reveals that in that case, Hibernate with PostgreSQL server is 5.8 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test0.435.515.511.58.08.5
Element Collection Test0.160.0251.40.0170.780.021
Inheritance Test0.395.217.614.09.09.6
Indexing Test0.434.616.613.38.58.9
Graph (Binary Tree) Test0.530.610.760.780.650.70
Multithreading Test0.1911.311.017.05.614.2
All Tests0.354.510.59.45.47.0

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

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 PostgreSQL database server (11.3) reveals that in that case, Hibernate with PostgreSQL server is 59.5 times faster than EclipseLink with MySQL server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.017) to the normalized speed of EclipseLink with MySQL database server (1.4) reveals that in that case, Hibernate with PostgreSQL server is 82.4 times slower 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test1.555.50.446.10.9530.8
Element Collection Test1.411.00.430.0160.925.5
Inheritance Test1.152.30.618.70.8630.5
Indexing Test0.260.0500.528.80.394.4
Multithreading Test1.955.20.729.21.332.2
All Tests1.234.80.546.60.8820.7

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

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (1.1) to the normalized speed of Hibernate with PostgreSQL database server (52.3) reveals that in that case, Hibernate with PostgreSQL server is 47.5 times faster than EclipseLink with MySQL server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.016) to the normalized speed of EclipseLink with MySQL database server (0.43) reveals that in that case, Hibernate with PostgreSQL server is 26.9 times slower 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test0.395.31.82.71.14.0
Element Collection Test0.230.0671.40.0260.830.046
Inheritance Test0.425.42.63.81.54.6
Indexing Test0.465.43.14.31.84.8
Graph (Binary Tree) Test0.671.10.410.580.540.82
Multithreading Test0.4829.62.66.31.518.0
All Tests0.447.82.02.91.25.4

The results above show that in general Hibernate with PostgreSQL server 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 PostgreSQL database server (5.4) reveals that in these tests, Hibernate with PostgreSQL server is 4.5 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 PostgreSQL database server (29.6) reveals that in that case, Hibernate with PostgreSQL server is 61.7 times faster than EclipseLink with MySQL server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.026) to the normalized speed of EclipseLink with MySQL database server (1.4) reveals that in that case, Hibernate with PostgreSQL server is 53.8 times slower 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test0.355.31.74.21.04.8
Element Collection Test0.110.0200.51stopped0.310.0098
Inheritance Test0.295.11.64.20.944.6
Indexing Test0.469.51.96.31.27.9
Graph (Binary Tree) Test0.540.0120.490.0120.510.012
Multithreading Test0.3123.33.621.81.922.5
All Tests0.347.21.66.10.986.6

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (6.6) reveals that in these tests, Hibernate with PostgreSQL server is 6.7 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 PostgreSQL database server (23.3) reveals that in that case, Hibernate with PostgreSQL server is 75.2 times faster than EclipseLink with MySQL server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.012) to the normalized speed of EclipseLink with MySQL database server (0.54) reveals that in that case, Hibernate with PostgreSQL server is 45.0 times slower 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
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
EclipseLink
MySQL server
Hibernate
PostgreSQL server
Basic Person Test1.315.74.25.62.710.7
Element Collection Test0.692.80.890.350.791.6
Inheritance Test1.115.04.86.92.910.9
Indexing Test1.45.84.97.83.26.8
Graph (Binary Tree) Test0.851.20.731.10.791.1
Multithreading Test2.030.24.013.63.021.9
All Tests1.212.13.36.02.39.1

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

A huge performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (2.0) to the normalized speed of Hibernate with PostgreSQL database server (30.2) reveals that in that case, Hibernate with PostgreSQL server is 15.1 times faster than EclipseLink with MySQL server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.35) to the normalized speed of EclipseLink with MySQL database server (0.89) reveals that in that case, Hibernate with PostgreSQL server is 2.5 times slower than EclipseLink with MySQL server.

Other Head to Head DBMS/JPA Comparisons