Comparison of EclipseLink with PostgreSQL server vs Hibernate with H2 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 Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 7.3 | 18.1 | 4.2 | 9.0 | 5.8 | 13.5 |
Element Collection Test | 3.1 | 13.0 | 1.9 | 6.8 | 2.5 | 9.9 |
Inheritance Test | 6.9 | 21.0 | 5.0 | 9.4 | 5.9 | 15.2 |
Indexing Test | 10.0 | 29.9 | 6.8 | 18.4 | 8.4 | 24.1 |
Graph (Binary Tree) Test | 3.5 | 17.2 | 3.3 | 20.1 | 3.4 | 18.7 |
Multithreading Test | 31.8 | 36.9 | 14.5 | 11.5 | 23.1 | 24.2 |
All Tests | 10.4 | 22.6 | 6.0 | 12.5 | 8.2 | 17.6 |
The results above show that in general Hibernate with H2 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 H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 2.1 times faster than EclipseLink with PostgreSQL server.
A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (3.3) to the normalized speed of Hibernate with H2 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 6.1 times faster than EclipseLink with PostgreSQL server.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 6.8 | 16.6 | 17.2 | 13.3 | 12.0 | 15.0 |
Element Collection Test | 0.026 | 4.3 | 0.020 | 4.0 | 0.023 | 4.1 |
Inheritance Test | 6.0 | 10.4 | 19.7 | 17.5 | 12.9 | 13.9 |
Indexing Test | 5.6 | 10.8 | 19.5 | 15.2 | 12.6 | 13.0 |
Graph (Binary Tree) Test | 0.47 | 2.5 | 0.61 | 4.0 | 0.54 | 3.3 |
Multithreading Test | 13.5 | 16.2 | 27.8 | 15.7 | 20.6 | 15.9 |
All Tests | 5.4 | 10.1 | 14.1 | 11.6 | 9.8 | 10.9 |
The results above show that in general Hibernate with H2 embedded is slightly 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 H2 embedded database (4.0) reveals that in that case, Hibernate with H2 embedded is 200 times faster than EclipseLink with PostgreSQL server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 55.5 | 4.5 | 7.8 | 1.2 | 31.6 | 2.8 |
Element Collection Test | 15.4 | 4.4 | 0.028 | 1.4 | 7.7 | 2.9 |
Inheritance Test | 54.9 | 3.1 | 11.5 | 1.5 | 33.2 | 2.3 |
Indexing Test | 0.077 | 6.6 | 10.0 | 10.5 | 5.1 | 8.6 |
Multithreading Test | 55.3 | 1.2 | 12.0 | 0.59 | 33.7 | 0.89 |
All Tests | 36.2 | 4.0 | 8.3 | 3.0 | 22.3 | 3.5 |
The results above show that in general EclipseLink with PostgreSQL server is much more efficient than Hibernate with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 embedded database (3.5) to the normalized speed of EclipseLink with PostgreSQL database server (22.3) reveals that in these tests, EclipseLink with PostgreSQL server is 6.4 times faster than Hibernate with H2 embedded.
A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (1.2) to the normalized speed of EclipseLink with PostgreSQL database server (55.3) reveals that in that case, EclipseLink with PostgreSQL server is 46.1 times faster than Hibernate with H2 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 H2 embedded database (6.6) reveals that in that case, EclipseLink with PostgreSQL server is 85.7 times slower than Hibernate with H2 embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 6.2 | 12.1 | 4.1 | 6.5 | 5.1 | 9.3 |
Element Collection Test | 0.080 | 7.4 | 0.028 | 5.3 | 0.054 | 6.3 |
Inheritance Test | 6.4 | 10.8 | 6.1 | 8.5 | 6.2 | 9.6 |
Indexing Test | 6.5 | 10.0 | 7.0 | 7.5 | 6.8 | 8.8 |
Graph (Binary Tree) Test | 0.90 | 4.4 | 0.50 | 2.3 | 0.70 | 3.4 |
Multithreading Test | 36.0 | 16.2 | 9.1 | 4.0 | 22.5 | 10.1 |
All Tests | 9.3 | 10.1 | 4.5 | 5.7 | 6.9 | 7.9 |
The results above show that in general Hibernate with H2 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 H2 embedded database (5.3) reveals that in that case, Hibernate with H2 embedded is 189 times faster than EclipseLink with PostgreSQL server.
On the other hand, Hibernate with H2 embedded is slower, for instance, when using multithreading with large transaction size. Comparing the normalized speed of Hibernate with H2 embedded database (4.0) to the normalized speed of EclipseLink with PostgreSQL database server (9.1) reveals that in that case, Hibernate with H2 embedded is 2.3 times slower than EclipseLink with PostgreSQL server.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 5.7 | 19.7 | 5.7 | 11.4 | 5.7 | 15.5 |
Element Collection Test | 0.025 | 6.9 | stopped | 4.5 | 0.012 | 5.7 |
Inheritance Test | 5.5 | 15.6 | 5.4 | 12.9 | 5.4 | 14.2 |
Indexing Test | 10.4 | 23.2 | 10.0 | 12.4 | 10.2 | 17.8 |
Graph (Binary Tree) Test | 0.016 | 4.0 | 0.013 | 4.2 | 0.015 | 4.1 |
Multithreading Test | 26.3 | 27.4 | 16.8 | 22.7 | 21.6 | 25.0 |
All Tests | 8.0 | 16.1 | 6.3 | 11.4 | 7.2 | 13.7 |
The results above show that in general Hibernate with H2 embedded is more efficient than EclipseLink with PostgreSQL server in deleting JPA entity objects from the database.
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 H2 embedded database (4.2) reveals that in that case, Hibernate with H2 embedded is 323 times faster than EclipseLink with PostgreSQL server.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded | EclipseLink PostgreSQL server | Hibernate H2 embedded |
Basic Person Test | 16.3 | 14.2 | 7.8 | 8.3 | 12.1 | 11.2 |
Element Collection Test | 3.7 | 7.2 | 0.40 | 4.4 | 2.1 | 5.8 |
Inheritance Test | 15.9 | 12.2 | 9.5 | 9.9 | 12.7 | 11.0 |
Indexing Test | 6.5 | 16.1 | 10.7 | 12.8 | 8.6 | 14.5 |
Graph (Binary Tree) Test | 1.2 | 7.0 | 1.1 | 7.7 | 1.2 | 7.3 |
Multithreading Test | 32.6 | 19.6 | 16.0 | 10.9 | 24.3 | 15.2 |
All Tests | 13.1 | 12.9 | 7.8 | 9.0 | 10.5 | 11.0 |
The results above show that in general Hibernate with H2 embedded is slightly 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 H2 embedded database (4.4) reveals that in that case, Hibernate with H2 embedded is 11.0 times faster than EclipseLink with PostgreSQL server.
Other Head to Head DBMS/JPA Comparisons
EclipseLink with PostgreSQL server against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- Hibernate with Derby embedded
- Hibernate with H2 embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with Derby server
- Hibernate with H2 server
- Hibernate with MySQL server
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server
Hibernate with H2 embedded against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- EclipseLink with PostgreSQL server
- Hibernate with Derby embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with Derby server
- Hibernate with H2 server
- Hibernate with MySQL server
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server