Comparison of OpenJPA with H2 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 Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 17.1 | 7.3 | 5.8 | 4.2 | 11.5 | 5.8 |
Element Collection Test | 10.9 | 3.1 | 4.9 | 1.9 | 7.9 | 2.5 |
Inheritance Test | 14.3 | 6.9 | 5.9 | 5.0 | 10.1 | 5.9 |
Indexing Test | 24.4 | 10.0 | 13.7 | 6.8 | 19.1 | 8.4 |
Graph (Binary Tree) Test | 6.8 | 3.5 | 6.7 | 3.3 | 6.7 | 3.4 |
Multithreading Test | 34.2 | 31.8 | 10.2 | 14.5 | 22.2 | 23.1 |
All Tests | 17.9 | 10.4 | 7.9 | 6.0 | 12.9 | 8.2 |
The results above show that in general OpenJPA with H2 embedded is more efficient than EclipseLink with PostgreSQL server in persisting JPA entity objects to the database.
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 OpenJPA with H2 embedded database (10.9) reveals that in that case, OpenJPA with H2 embedded is 3.5 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 | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 14.6 | 6.8 | 27.2 | 17.2 | 20.9 | 12.0 |
Element Collection Test | 0.0046 | 0.026 | 4.3 | 0.020 | 2.1 | 0.023 |
Inheritance Test | 0.011 | 6.0 | 7.4 | 19.7 | 3.7 | 12.9 |
Indexing Test | 17.0 | 5.6 | 35.0 | 19.5 | 26.0 | 12.6 |
Graph (Binary Tree) Test | 1.0 | 0.47 | 1.4 | 0.61 | 1.2 | 0.54 |
Multithreading Test | 18.7 | 13.5 | 27.6 | 27.8 | 23.1 | 20.6 |
All Tests | 8.6 | 5.4 | 17.1 | 14.1 | 12.8 | 9.8 |
The results above show that in general OpenJPA with H2 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 OpenJPA with H2 embedded database (4.3) reveals that in that case, OpenJPA with H2 embedded is 215 times faster than EclipseLink with PostgreSQL server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of EclipseLink with PostgreSQL database server (6.0) reveals that in that case, OpenJPA with H2 embedded is 545 times slower 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 | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 5.0 | 55.5 | 1.1 | 7.8 | 3.1 | 31.6 |
Element Collection Test | 1.7 | 15.4 | 1.3 | 0.028 | 1.5 | 7.7 |
Inheritance Test | 2.2 | 54.9 | 1.2 | 11.5 | 1.7 | 33.2 |
Indexing Test | 13.8 | 0.077 | 23.2 | 10.0 | 18.5 | 5.1 |
Multithreading Test | 1.4 | 55.3 | 0.60 | 12.0 | 0.99 | 33.7 |
All Tests | 4.8 | 36.2 | 5.5 | 8.3 | 5.1 | 22.3 |
The results above show that in general EclipseLink with PostgreSQL server is much more efficient than OpenJPA with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 embedded database (5.1) to the normalized speed of EclipseLink with PostgreSQL database server (22.3) reveals that in these tests, EclipseLink with PostgreSQL server is 4.4 times faster than OpenJPA with H2 embedded.
A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (1.4) to the normalized speed of EclipseLink with PostgreSQL database server (55.3) reveals that in that case, EclipseLink with PostgreSQL server is 39.5 times faster than OpenJPA 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 OpenJPA with H2 embedded database (13.8) reveals that in that case, EclipseLink with PostgreSQL server is 179 times slower than OpenJPA with H2 embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 10.0 | 6.2 | 6.0 | 4.1 | 8.0 | 5.1 |
Element Collection Test | 0.011 | 0.080 | 3.8 | 0.028 | 1.9 | 0.054 |
Inheritance Test | 0.046 | 6.4 | 5.0 | 6.1 | 2.5 | 6.2 |
Indexing Test | 8.9 | 6.5 | 7.0 | 7.0 | 8.0 | 6.8 |
Graph (Binary Tree) Test | 2.4 | 0.90 | 1.3 | 0.50 | 1.9 | 0.70 |
Multithreading Test | 16.6 | 36.0 | 4.3 | 9.1 | 10.4 | 22.5 |
All Tests | 6.3 | 9.3 | 4.6 | 4.5 | 5.4 | 6.9 |
The results above show that in general EclipseLink with PostgreSQL server is slightly more efficient than OpenJPA with H2 embedded in updating JPA entity objects in the database.
A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.046) to the normalized speed of EclipseLink with PostgreSQL database server (6.4) reveals that in that case, EclipseLink with PostgreSQL server is 139 times faster than OpenJPA with H2 embedded.
On the other hand, EclipseLink with PostgreSQL server is slower, for instance, 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 OpenJPA with H2 embedded database (3.8) reveals that in that case, EclipseLink with PostgreSQL server is 136 times slower than OpenJPA with H2 embedded.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 18.3 | 5.7 | 11.1 | 5.7 | 14.7 | 5.7 |
Element Collection Test | 0.012 | 0.025 | 2.9 | stopped | 1.4 | 0.012 |
Inheritance Test | 0.030 | 5.5 | 6.6 | 5.4 | 3.3 | 5.4 |
Indexing Test | 23.2 | 10.4 | 9.7 | 10.0 | 16.4 | 10.2 |
Graph (Binary Tree) Test | 1.8 | 0.016 | 2.4 | 0.013 | 2.1 | 0.015 |
Multithreading Test | 31.2 | 26.3 | 17.3 | 16.8 | 24.2 | 21.6 |
All Tests | 12.4 | 8.0 | 8.3 | 6.3 | 10.4 | 7.2 |
The results above show that in general OpenJPA 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 OpenJPA with H2 embedded database (2.4) reveals that in that case, OpenJPA with H2 embedded is 185 times faster than EclipseLink with PostgreSQL server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.030) to the normalized speed of EclipseLink with PostgreSQL database server (5.5) reveals that in that case, OpenJPA with H2 embedded is 183 times slower 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 | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server | OpenJPA H2 embedded | EclipseLink PostgreSQL server |
Basic Person Test | 13.0 | 16.3 | 10.2 | 7.8 | 11.6 | 12.1 |
Element Collection Test | 2.5 | 3.7 | 3.4 | 0.40 | 3.0 | 2.1 |
Inheritance Test | 3.3 | 15.9 | 5.2 | 9.5 | 4.3 | 12.7 |
Indexing Test | 17.5 | 6.5 | 17.7 | 10.7 | 17.6 | 8.6 |
Graph (Binary Tree) Test | 3.0 | 1.2 | 3.0 | 1.1 | 3.0 | 1.2 |
Multithreading Test | 20.4 | 32.6 | 12.0 | 16.0 | 16.2 | 24.3 |
All Tests | 10.2 | 13.1 | 8.8 | 7.8 | 9.5 | 10.5 |
The results above show that in general EclipseLink with PostgreSQL server is slightly more efficient than OpenJPA with H2 embedded in performing JPA database operations.
A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (3.3) to the normalized speed of EclipseLink with PostgreSQL database server (15.9) reveals that in that case, EclipseLink with PostgreSQL server is 4.8 times faster than OpenJPA with H2 embedded.
On the other hand, EclipseLink with PostgreSQL server is slower, for instance, 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 OpenJPA with H2 embedded database (3.4) reveals that in that case, EclipseLink with PostgreSQL server is 8.5 times slower than OpenJPA with H2 embedded.
Other Head to Head DBMS/JPA Comparisons
OpenJPA 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 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 HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server
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