Compare with

Comparison of EclipseLink with PostgreSQL server vs Hibernate with Derby embedded

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
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test7.35.94.23.85.84.9
Element Collection Test3.12.91.91.82.52.3
Inheritance Test6.95.35.03.75.94.5
Indexing Test10.07.06.84.88.45.9
Graph (Binary Tree) Test3.51.93.31.73.41.8
Multithreading Test31.810.514.53.723.17.1
All Tests10.45.66.03.38.24.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test6.814.217.216.412.015.3
Element Collection Test0.0264.40.0204.90.0234.6
Inheritance Test6.010.319.718.612.914.4
Indexing Test5.610.019.516.412.613.2
Graph (Binary Tree) Test0.472.60.613.00.542.8
Multithreading Test13.519.327.819.320.619.3
All Tests5.410.114.113.19.811.6

The results above show that in general Hibernate with Derby embedded is slightly more efficient than EclipseLink 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 EclipseLink with PostgreSQL database server (0.020) to the normalized speed of Hibernate with Derby embedded database (4.9) reveals that in that case, Hibernate with Derby embedded is 245 times faster than EclipseLink with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test55.549.37.86.831.628.1
Element Collection Test15.437.60.0282.77.720.1
Inheritance Test54.924.111.57.633.215.9
Indexing Test0.0775.310.014.85.110.1
Multithreading Test55.339.712.06.133.722.9
All Tests36.231.28.37.622.319.4

The results above show that in general EclipseLink with PostgreSQL server is slightly more efficient than Hibernate with Derby embedded 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 Hibernate with Derby embedded database (24.1) to the normalized speed of EclipseLink with PostgreSQL database server (54.9) reveals that in that case, EclipseLink with PostgreSQL server is 2.3 times faster than Hibernate with Derby embedded.

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.028) to the normalized speed of Hibernate with Derby embedded database (2.7) reveals that in that case, EclipseLink with PostgreSQL server is 96.4 times slower than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test6.24.54.13.25.13.8
Element Collection Test0.0803.90.0283.10.0543.5
Inheritance Test6.44.66.14.56.24.5
Indexing Test6.54.67.05.56.85.1
Graph (Binary Tree) Test0.902.70.501.20.702.0
Multithreading Test36.011.69.12.622.57.1
All Tests9.35.34.53.36.94.3

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test5.73.85.74.25.74.0
Element Collection Test0.0252.3stopped1.50.0121.9
Inheritance Test5.54.05.44.35.44.2
Indexing Test10.45.510.03.610.24.6
Graph (Binary Tree) Test0.0160.740.0130.960.0150.85
Multithreading Test26.35.616.84.921.65.3
All Tests8.03.76.33.37.23.5

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

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
Basic Person Test16.315.57.86.912.111.2
Element Collection Test3.710.20.402.82.16.5
Inheritance Test15.99.79.57.712.78.7
Indexing Test6.56.510.79.08.67.8
Graph (Binary Tree) Test1.22.01.11.71.21.8
Multithreading Test32.617.316.07.324.312.3
All Tests13.110.57.86.110.58.3

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

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

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

Other Head to Head DBMS/JPA Comparisons