Compare with

Comparison of EclipseLink with PostgreSQL server vs Hibernate 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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test7.332.64.213.15.822.9
Element Collection Test3.115.11.98.22.511.7
Inheritance Test6.925.55.013.65.919.5
Indexing Test10.029.66.818.88.424.2
Graph (Binary Tree) Test3.513.83.315.63.414.7
Multithreading Test31.837.414.513.023.125.2
All Tests10.425.66.013.78.219.7

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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test6.824.817.216.412.020.6
Element Collection Test0.02611.30.02010.80.02311.0
Inheritance Test6.021.719.721.012.921.3
Indexing Test5.611.919.521.512.616.7
Graph (Binary Tree) Test0.473.60.614.70.544.1
Multithreading Test13.519.827.821.520.620.6
All Tests5.415.514.116.09.815.7

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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test55.53.67.80.8831.62.2
Element Collection Test15.43.40.0281.77.72.6
Inheritance Test54.92.911.51.033.21.9
Indexing Test0.0779.910.021.75.115.8
Multithreading Test55.31.112.00.5833.70.82
All Tests36.24.28.35.222.34.7

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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test6.214.24.15.05.19.6
Element Collection Test0.08010.10.0285.60.0547.8
Inheritance Test6.413.46.17.56.210.5
Indexing Test6.510.77.06.16.88.4
Graph (Binary Tree) Test0.903.70.502.50.703.1
Multithreading Test36.023.99.13.822.513.9
All Tests9.312.74.55.16.98.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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test5.726.15.717.55.721.8
Element Collection Test0.0259.1stopped5.20.0127.1
Inheritance Test5.521.45.417.75.419.6
Indexing Test10.433.010.016.310.224.7
Graph (Binary Tree) Test0.0165.40.0138.20.0156.8
Multithreading Test26.338.516.828.621.633.5
All Tests8.022.36.315.67.218.9

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
 EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
EclipseLink
PostgreSQL server
Hibernate
HSQLDB embedded
Basic Person Test16.320.27.810.612.115.4
Element Collection Test3.79.80.406.32.18.0
Inheritance Test15.917.09.512.212.714.6
Indexing Test6.519.010.716.98.618.0
Graph (Binary Tree) Test1.26.61.17.81.27.2
Multithreading Test32.624.116.013.524.318.8
All Tests13.116.57.811.310.513.9

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