Compare with

Comparison of EclipseLink with Derby embedded 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
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test5.57.13.73.44.65.2
Element Collection Test3.02.91.71.72.42.3
Inheritance Test5.37.03.53.64.45.3
Indexing Test6.99.34.66.15.87.7
Graph (Binary Tree) Test2.03.01.92.91.92.9
Multithreading Test9.331.74.113.96.722.8
All Tests5.310.23.25.34.37.7

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with Derby embedded in persisting JPA entity objects to the database.

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (9.3) to the normalized speed of Hibernate with PostgreSQL database server (31.7) reveals that in that case, Hibernate with PostgreSQL server is 3.4 times faster than EclipseLink with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test16.45.558.711.537.58.5
Element Collection Test7.50.02513.30.01710.40.021
Inheritance Test17.15.258.914.038.09.6
Indexing Test14.24.667.413.340.88.9
Graph (Binary Tree) Test2.80.615.70.784.20.70
Multithreading Test28.011.348.717.038.414.2
All Tests14.34.542.19.428.27.0

The results above show that in general EclipseLink with Derby embedded is much more efficient than Hibernate with PostgreSQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with PostgreSQL database server (7.0) to the normalized speed of EclipseLink with Derby embedded database (28.2) reveals that in these tests, EclipseLink with Derby embedded is 4.0 times faster than Hibernate with PostgreSQL server.

A huge performance gap has been detected 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 Derby embedded database (13.3) reveals that in that case, EclipseLink with Derby embedded is 782 times faster than Hibernate with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test53.455.513.86.133.630.8
Element Collection Test37.911.04.40.01621.25.5
Inheritance Test37.452.315.08.726.230.5
Indexing Test7.60.05049.38.828.44.4
Multithreading Test41.255.26.19.223.632.2
All Tests35.534.817.76.626.620.7

The results above show that in general EclipseLink with Derby embedded is slightly more efficient than Hibernate with PostgreSQL server in executing the tested JPA queries.

A huge performance gap has been detected 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 Derby embedded database (4.4) reveals that in that case, EclipseLink with Derby embedded is 275 times faster than Hibernate with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test6.45.36.72.76.54.0
Element Collection Test5.40.0676.20.0265.80.046
Inheritance Test6.55.49.23.87.84.6
Indexing Test7.35.411.14.39.24.8
Graph (Binary Tree) Test2.81.11.70.582.20.82
Multithreading Test21.329.65.06.313.118.0
All Tests8.37.86.62.97.55.4

The results above show that in general EclipseLink with Derby embedded is more efficient than Hibernate with PostgreSQL server in updating JPA entity objects in the database.

A huge performance gap has been detected 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 Derby embedded database (6.2) reveals that in that case, EclipseLink with Derby embedded is 238 times faster than Hibernate with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test4.65.34.74.24.64.8
Element Collection Test2.50.0201.4stopped1.90.0098
Inheritance Test3.95.14.54.24.24.6
Indexing Test6.29.53.86.35.07.9
Graph (Binary Tree) Test1.10.0121.00.0121.10.012
Multithreading Test6.223.35.821.86.022.5
All Tests4.17.23.56.13.86.6

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with Derby embedded in deleting JPA entity objects from the database.

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (5.8) to the normalized speed of Hibernate with PostgreSQL database server (21.8) reveals that in that case, Hibernate with PostgreSQL server is 3.8 times faster than EclipseLink with Derby embedded.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.020) to the normalized speed of EclipseLink with Derby embedded database (2.5) reveals that in that case, Hibernate with PostgreSQL server is 125 times slower than EclipseLink with Derby embedded.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
EclipseLink
Derby embedded
Hibernate
PostgreSQL server
Basic Person Test17.315.717.55.617.410.7
Element Collection Test11.32.85.40.358.31.6
Inheritance Test14.015.018.26.916.110.9
Indexing Test8.45.827.27.817.86.8
Graph (Binary Tree) Test2.21.22.61.12.41.1
Multithreading Test21.230.213.913.617.621.9
All Tests12.712.114.56.013.69.1

The results above show that in general EclipseLink with Derby embedded is more efficient than Hibernate with PostgreSQL server in performing JPA database operations.

A huge performance gap has been detected 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 Derby embedded database (5.4) reveals that in that case, EclipseLink with Derby embedded is 15.4 times faster than Hibernate with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons