Compare with

Comparison of Hibernate with PostgreSQL server vs EclipseLink with H2 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
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test7.15.63.42.55.24.0
Element Collection Test2.94.21.71.52.32.8
Inheritance Test7.06.63.62.15.34.4
Indexing Test9.39.76.14.17.76.9
Graph (Binary Tree) Test3.04.72.93.52.94.1
Multithreading Test31.710.213.94.022.87.1
All Tests10.26.85.32.97.74.9

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
 Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.55.511.58.28.56.8
Element Collection Test0.0253.20.0174.20.0213.7
Inheritance Test5.24.714.010.19.67.4
Indexing Test4.64.413.39.48.96.9
Graph (Binary Tree) Test0.611.10.781.90.701.5
Multithreading Test11.312.217.015.914.214.0
All Tests4.55.29.48.37.06.7

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
 Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test55.53.86.11.130.82.5
Element Collection Test11.04.10.0161.15.52.6
Inheritance Test52.33.28.71.330.52.3
Indexing Test0.0503.08.88.04.45.5
Multithreading Test55.21.19.21.032.21.1
All Tests34.83.06.62.520.72.8

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
 Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.34.52.72.24.03.4
Element Collection Test0.0673.80.0262.40.0463.1
Inheritance Test5.44.43.83.04.63.7
Indexing Test5.44.24.33.14.83.7
Graph (Binary Tree) Test1.11.40.580.790.821.1
Multithreading Test29.67.86.32.518.05.1
All Tests7.84.32.92.35.43.3

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
 Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.36.44.23.14.84.8
Element Collection Test0.0203.0stopped1.30.00982.2
Inheritance Test5.15.64.22.84.64.2
Indexing Test9.510.36.33.87.97.0
Graph (Binary Tree) Test0.0121.50.0121.30.0121.4
Multithreading Test23.37.021.84.922.56.0
All Tests7.25.66.12.96.64.3

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
 Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Hibernate
PostgreSQL server
EclipseLink
H2 server
Basic Person Test15.75.25.63.410.74.3
Element Collection Test2.83.60.352.11.62.9
Inheritance Test15.04.96.93.910.94.4
Indexing Test5.86.37.85.76.86.0
Graph (Binary Tree) Test1.22.11.11.91.12.0
Multithreading Test30.27.713.65.721.96.7
All Tests12.15.16.03.89.14.5

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