Compare with

Comparison of EclipseLink with H2 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
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test5.67.12.53.44.05.2
Element Collection Test4.22.91.51.72.82.3
Inheritance Test6.67.02.13.64.45.3
Indexing Test9.79.34.16.16.97.7
Graph (Binary Tree) Test4.73.03.52.94.12.9
Multithreading Test10.231.74.013.97.122.8
All Tests6.810.22.95.34.97.7

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with H2 server 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 EclipseLink with H2 database server (4.0) to the normalized speed of Hibernate with PostgreSQL database server (13.9) reveals that in that case, Hibernate with PostgreSQL server is 3.5 times faster than EclipseLink with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test5.55.58.211.56.88.5
Element Collection Test3.20.0254.20.0173.70.021
Inheritance Test4.75.210.114.07.49.6
Indexing Test4.44.69.413.36.98.9
Graph (Binary Tree) Test1.10.611.90.781.50.70
Multithreading Test12.211.315.917.014.014.2
All Tests5.24.58.39.46.77.0

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test3.855.51.16.12.530.8
Element Collection Test4.111.01.10.0162.65.5
Inheritance Test3.252.31.38.72.330.5
Indexing Test3.00.0508.08.85.54.4
Multithreading Test1.155.21.09.21.132.2
All Tests3.034.82.56.62.820.7

The results above show that in general Hibernate with PostgreSQL server is much more efficient than EclipseLink with H2 server in executing the tested JPA queries. Comparing the normalized speed of EclipseLink with H2 database server (2.8) to the normalized speed of Hibernate with PostgreSQL database server (20.7) reveals that in these tests, Hibernate with PostgreSQL server is 7.4 times faster than EclipseLink with H2 server.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (1.1) to the normalized speed of Hibernate with PostgreSQL database server (55.2) reveals that in that case, Hibernate with PostgreSQL server is 50.2 times faster than EclipseLink with H2 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 H2 database server (1.1) reveals that in that case, Hibernate with PostgreSQL server is 68.8 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test4.55.32.22.73.44.0
Element Collection Test3.80.0672.40.0263.10.046
Inheritance Test4.45.43.03.83.74.6
Indexing Test4.25.43.14.33.74.8
Graph (Binary Tree) Test1.41.10.790.581.10.82
Multithreading Test7.829.62.56.35.118.0
All Tests4.37.82.32.93.35.4

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with H2 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 H2 database server (7.8) to the normalized speed of Hibernate with PostgreSQL database server (29.6) reveals that in that case, Hibernate with PostgreSQL server is 3.8 times faster than EclipseLink with H2 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 H2 database server (2.4) reveals that in that case, Hibernate with PostgreSQL server is 92.3 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test6.45.33.14.24.84.8
Element Collection Test3.00.0201.3stopped2.20.0098
Inheritance Test5.65.12.84.24.24.6
Indexing Test10.39.53.86.37.07.9
Graph (Binary Tree) Test1.50.0121.30.0121.40.012
Multithreading Test7.023.34.921.86.022.5
All Tests5.67.22.96.14.36.6

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with H2 server 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 H2 database server (4.9) to the normalized speed of Hibernate with PostgreSQL database server (21.8) reveals that in that case, Hibernate with PostgreSQL server is 4.4 times faster than EclipseLink with H2 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 H2 database server (3.0) reveals that in that case, Hibernate with PostgreSQL server is 150 times slower than EclipseLink with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
Basic Person Test5.215.73.45.64.310.7
Element Collection Test3.62.82.10.352.91.6
Inheritance Test4.915.03.96.94.410.9
Indexing Test6.35.85.77.86.06.8
Graph (Binary Tree) Test2.11.21.91.12.01.1
Multithreading Test7.730.25.713.66.721.9
All Tests5.112.13.86.04.59.1

The results above show that in general Hibernate with PostgreSQL server is more efficient than EclipseLink with H2 server in performing JPA database operations. Comparing the normalized speed of EclipseLink with H2 database server (4.5) to the normalized speed of Hibernate with PostgreSQL database server (9.1) reveals that in these tests, Hibernate with PostgreSQL server is 2.0 times faster than EclipseLink with H2 server.

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

Other Head to Head DBMS/JPA Comparisons