Compare with

Comparison of EclipseLink with Derby 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
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test3.87.13.13.43.45.2
Element Collection Test2.22.91.51.71.82.3
Inheritance Test3.97.02.93.63.45.3
Indexing Test5.29.34.36.14.77.7
Graph (Binary Tree) Test1.93.01.72.91.82.9
Multithreading Test6.131.73.913.95.022.8
All Tests3.810.22.95.33.47.7

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with Derby server in persisting JPA entity objects to the database. Comparing the normalized speed of EclipseLink with Derby database server (3.4) to the normalized speed of Hibernate with PostgreSQL database server (7.7) reveals that in these tests, Hibernate with PostgreSQL server is 2.3 times faster than EclipseLink with Derby server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test6.45.511.311.58.88.5
Element Collection Test1.80.0252.40.0172.10.021
Inheritance Test3.75.212.914.08.39.6
Indexing Test3.64.612.813.38.28.9
Graph (Binary Tree) Test0.610.610.730.780.670.70
Multithreading Test8.511.319.817.014.114.2
All Tests4.14.510.09.47.07.0

The results above show that in general EclipseLink with Derby server is equivalent to Hibernate with PostgreSQL server in retrieving JPA entity objects from the database.

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 database server (2.4) reveals that in that case, EclipseLink with Derby server is 141 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 server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test45.855.55.36.125.630.8
Element Collection Test35.211.00.990.01618.15.5
Inheritance Test23.152.35.98.714.530.5
Indexing Test2.50.05012.28.87.44.4
Multithreading Test34.355.27.79.221.032.2
All Tests28.234.86.46.617.320.7

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

A large performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of EclipseLink with Derby database server (23.1) to the normalized speed of Hibernate with PostgreSQL database server (52.3) reveals that in that case, Hibernate with PostgreSQL server is 2.3 times faster than EclipseLink with Derby 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 Derby database server (0.99) reveals that in that case, Hibernate with PostgreSQL server is 61.9 times slower than EclipseLink with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test3.95.34.42.74.14.0
Element Collection Test1.70.0671.60.0261.60.046
Inheritance Test4.65.46.13.85.34.6
Indexing Test4.55.47.64.36.14.8
Graph (Binary Tree) Test0.701.10.420.580.560.82
Multithreading Test7.329.64.86.36.018.0
All Tests3.87.84.22.94.05.4

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with Derby database server (7.3) to the normalized speed of Hibernate with PostgreSQL database server (29.6) reveals that in that case, Hibernate with PostgreSQL server is 4.1 times faster than EclipseLink with Derby 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 Derby database server (1.6) reveals that in that case, Hibernate with PostgreSQL server is 61.5 times slower than EclipseLink with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test2.85.33.94.23.34.8
Element Collection Test1.20.0200.55stopped0.870.0098
Inheritance Test3.35.13.74.23.54.6
Indexing Test4.99.53.56.34.27.9
Graph (Binary Tree) Test0.510.0120.500.0120.510.012
Multithreading Test4.823.35.721.85.322.5
All Tests2.97.23.06.13.06.6

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with Derby server in deleting JPA entity objects from the database. Comparing the normalized speed of EclipseLink with Derby database server (3.0) to the normalized speed of Hibernate with PostgreSQL database server (6.6) reveals that in these tests, Hibernate with PostgreSQL server is 2.2 times faster than EclipseLink with Derby server.

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
EclipseLink
Derby server
Hibernate
PostgreSQL server
Basic Person Test12.515.75.65.69.110.7
Element Collection Test8.42.81.40.354.91.6
Inheritance Test7.715.06.36.97.010.9
Indexing Test4.15.88.17.86.16.8
Graph (Binary Tree) Test0.931.20.831.10.881.1
Multithreading Test12.230.28.413.610.321.9
All Tests7.912.15.26.06.69.1

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with Derby database server (12.2) to the normalized speed of Hibernate with PostgreSQL database server (30.2) reveals that in that case, Hibernate with PostgreSQL server is 2.5 times faster than EclipseLink with Derby 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 Derby database server (1.4) reveals that in that case, Hibernate with PostgreSQL server is 4.0 times slower than EclipseLink with Derby server.

Other Head to Head DBMS/JPA Comparisons