Compare with

Comparison of Hibernate with Derby embedded vs EclipseLink 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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test5.97.33.84.24.95.8
Element Collection Test2.93.11.81.92.32.5
Inheritance Test5.36.93.75.04.55.9
Indexing Test7.010.04.86.85.98.4
Graph (Binary Tree) Test1.93.51.73.31.83.4
Multithreading Test10.531.83.714.57.123.1
All Tests5.610.43.36.04.48.2

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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test14.26.816.417.215.312.0
Element Collection Test4.40.0264.90.0204.60.023
Inheritance Test10.36.018.619.714.412.9
Indexing Test10.05.616.419.513.212.6
Graph (Binary Tree) Test2.60.473.00.612.80.54
Multithreading Test19.313.519.327.819.320.6
All Tests10.15.413.114.111.69.8

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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test49.355.56.87.828.131.6
Element Collection Test37.615.42.70.02820.17.7
Inheritance Test24.154.97.611.515.933.2
Indexing Test5.30.07714.810.010.15.1
Multithreading Test39.755.36.112.022.933.7
All Tests31.236.27.68.319.422.3

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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test4.56.23.24.13.85.1
Element Collection Test3.90.0803.10.0283.50.054
Inheritance Test4.66.44.56.14.56.2
Indexing Test4.66.55.57.05.16.8
Graph (Binary Tree) Test2.70.901.20.502.00.70
Multithreading Test11.636.02.69.17.122.5
All Tests5.39.33.34.54.36.9

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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test3.85.74.25.74.05.7
Element Collection Test2.30.0251.5stopped1.90.012
Inheritance Test4.05.54.35.44.25.4
Indexing Test5.510.43.610.04.610.2
Graph (Binary Tree) Test0.740.0160.960.0130.850.015
Multithreading Test5.626.34.916.85.321.6
All Tests3.78.03.36.33.57.2

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
 Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Hibernate
Derby embedded
EclipseLink
PostgreSQL server
Basic Person Test15.516.36.97.811.212.1
Element Collection Test10.23.72.80.406.52.1
Inheritance Test9.715.97.79.58.712.7
Indexing Test6.56.59.010.77.88.6
Graph (Binary Tree) Test2.01.21.71.11.81.2
Multithreading Test17.332.67.316.012.324.3
All Tests10.513.16.17.88.310.5

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