Compare with

Comparison of Hibernate with PostgreSQL server vs EclipseLink with HSQLDB 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
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test7.127.13.417.25.222.2
Element Collection Test2.917.21.78.22.312.7
Inheritance Test7.026.73.611.95.319.3
Indexing Test9.330.66.118.67.724.6
Graph (Binary Tree) Test3.020.02.915.92.918.0
Multithreading Test31.732.513.911.422.822.0
All Tests10.225.75.313.97.719.8

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test5.524.411.536.08.530.2
Element Collection Test0.02514.90.01719.10.02117.0
Inheritance Test5.222.814.040.09.631.4
Indexing Test4.620.713.338.78.929.7
Graph (Binary Tree) Test0.618.70.7814.20.7011.4
Multithreading Test11.324.217.028.014.226.1
All Tests4.519.39.429.37.024.3

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test55.52.96.10.8830.81.9
Element Collection Test11.03.20.0161.45.52.3
Inheritance Test52.32.68.71.130.51.9
Indexing Test0.05021.58.833.34.427.4
Multithreading Test55.21.19.20.5232.20.82
All Tests34.86.36.67.420.76.9

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of EclipseLink with HSQLDB embedded database (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 HSQLDB embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test5.317.92.77.04.012.5
Element Collection Test0.06714.60.0268.30.04611.4
Inheritance Test5.416.23.89.74.613.0
Indexing Test5.412.04.36.84.89.4
Graph (Binary Tree) Test1.14.70.583.40.824.0
Multithreading Test29.624.46.34.418.014.4
All Tests7.815.02.96.65.410.8

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test5.332.34.220.34.826.3
Element Collection Test0.02014.3stopped6.00.009810.2
Inheritance Test5.129.24.223.94.626.6
Indexing Test9.555.36.327.17.941.2
Graph (Binary Tree) Test0.0126.80.01214.10.01210.4
Multithreading Test23.352.921.828.422.540.6
All Tests7.231.86.120.06.625.9

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Hibernate
PostgreSQL server
EclipseLink
HSQLDB embedded
Basic Person Test15.720.95.616.310.718.6
Element Collection Test2.812.80.358.61.610.7
Inheritance Test15.019.56.917.310.918.4
Indexing Test5.828.07.824.96.826.5
Graph (Binary Tree) Test1.210.01.111.91.111.0
Multithreading Test30.227.013.614.621.920.8
All Tests12.120.16.015.79.117.9

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

Other Head to Head DBMS/JPA Comparisons