Compare with

Comparison of Hibernate with HSQLDB 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
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test32.67.313.14.222.95.8
Element Collection Test15.13.18.21.911.72.5
Inheritance Test25.56.913.65.019.55.9
Indexing Test29.610.018.86.824.28.4
Graph (Binary Tree) Test13.83.515.63.314.73.4
Multithreading Test37.431.813.014.525.223.1
All Tests25.610.413.76.019.78.2

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

A large performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (3.1) to the normalized speed of Hibernate with HSQLDB embedded database (15.1) reveals that in that case, Hibernate with HSQLDB embedded is 4.9 times faster than EclipseLink with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test24.86.816.417.220.612.0
Element Collection Test11.30.02610.80.02011.00.023
Inheritance Test21.76.021.019.721.312.9
Indexing Test11.95.621.519.516.712.6
Graph (Binary Tree) Test3.60.474.70.614.10.54
Multithreading Test19.813.521.527.820.620.6
All Tests15.55.416.014.115.79.8

The results above show that in general Hibernate with HSQLDB embedded is 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 HSQLDB embedded database (10.8) reveals that in that case, Hibernate with HSQLDB embedded is 540 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
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test3.655.50.887.82.231.6
Element Collection Test3.415.41.70.0282.67.7
Inheritance Test2.954.91.011.51.933.2
Indexing Test9.90.07721.710.015.85.1
Multithreading Test1.155.30.5812.00.8233.7
All Tests4.236.25.28.34.722.3

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (1.1) to the normalized speed of EclipseLink with PostgreSQL database server (55.3) reveals that in that case, EclipseLink with PostgreSQL server is 50.3 times faster than Hibernate with HSQLDB embedded.

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.077) to the normalized speed of Hibernate with HSQLDB embedded database (9.9) reveals that in that case, EclipseLink with PostgreSQL server is 129 times slower than Hibernate with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test14.26.25.04.19.65.1
Element Collection Test10.10.0805.60.0287.80.054
Inheritance Test13.46.47.56.110.56.2
Indexing Test10.76.56.17.08.46.8
Graph (Binary Tree) Test3.70.902.50.503.10.70
Multithreading Test23.936.03.89.113.922.5
All Tests12.79.35.14.58.96.9

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

A huge performance gap has been detected 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 HSQLDB embedded database (5.6) reveals that in that case, Hibernate with HSQLDB embedded is 200 times faster than EclipseLink with PostgreSQL server.

On the other hand, Hibernate with HSQLDB embedded is slower, for instance, when using multithreading with large transaction size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (3.8) to the normalized speed of EclipseLink with PostgreSQL database server (9.1) reveals that in that case, Hibernate with HSQLDB embedded is 2.4 times slower than EclipseLink with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test26.15.717.55.721.85.7
Element Collection Test9.10.0255.2stopped7.10.012
Inheritance Test21.45.517.75.419.65.4
Indexing Test33.010.416.310.024.710.2
Graph (Binary Tree) Test5.40.0168.20.0136.80.015
Multithreading Test38.526.328.616.833.521.6
All Tests22.38.015.66.318.97.2

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.013) to the normalized speed of Hibernate with HSQLDB embedded database (8.2) reveals that in that case, Hibernate with HSQLDB embedded is 631 times faster than EclipseLink with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Basic Person Test20.216.310.67.815.412.1
Element Collection Test9.83.76.30.408.02.1
Inheritance Test17.015.912.29.514.612.7
Indexing Test19.06.516.910.718.08.6
Graph (Binary Tree) Test6.61.27.81.17.21.2
Multithreading Test24.132.613.516.018.824.3
All Tests16.513.111.37.813.910.5

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

A huge performance gap has been detected 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 HSQLDB embedded database (6.3) reveals that in that case, Hibernate with HSQLDB embedded is 15.7 times faster than EclipseLink with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons