Comparison of OpenJPA with HSQLDB embedded vs Hibernate 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 HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 13.3 | 7.1 | 6.9 | 3.4 | 10.1 | 5.2 |
Element Collection Test | 8.6 | 2.9 | 5.3 | 1.7 | 7.0 | 2.3 |
Inheritance Test | 12.2 | 7.0 | 5.8 | 3.6 | 9.0 | 5.3 |
Indexing Test | 16.7 | 9.3 | 9.1 | 6.1 | 12.9 | 7.7 |
Graph (Binary Tree) Test | 6.1 | 3.0 | 7.3 | 2.9 | 6.7 | 2.9 |
Multithreading Test | 26.8 | 31.7 | 7.0 | 13.9 | 16.9 | 22.8 |
All Tests | 13.9 | 10.2 | 6.9 | 5.3 | 10.4 | 7.7 |
The results above show that in general OpenJPA with HSQLDB embedded is more efficient than Hibernate with PostgreSQL server in persisting JPA entity objects to the database.
A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (1.7) to the normalized speed of OpenJPA with HSQLDB embedded database (5.3) reveals that in that case, OpenJPA with HSQLDB embedded is 3.1 times faster than Hibernate with PostgreSQL server.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 21.8 | 5.5 | 30.1 | 11.5 | 25.9 | 8.5 |
Element Collection Test | 0.0068 | 0.025 | 4.5 | 0.017 | 2.2 | 0.021 |
Inheritance Test | 0.0025 | 5.2 | 2.0 | 14.0 | 0.98 | 9.6 |
Indexing Test | 22.1 | 4.6 | 43.6 | 13.3 | 32.9 | 8.9 |
Graph (Binary Tree) Test | 2.1 | 0.61 | 2.1 | 0.78 | 2.1 | 0.70 |
Multithreading Test | 20.9 | 11.3 | 23.5 | 17.0 | 22.2 | 14.2 |
All Tests | 11.1 | 4.5 | 17.6 | 9.4 | 14.4 | 7.0 |
The results above show that in general OpenJPA with HSQLDB embedded is 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 OpenJPA with HSQLDB embedded database (14.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.1 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 OpenJPA with HSQLDB embedded database (4.5) reveals that in that case, OpenJPA with HSQLDB embedded is 265 times faster than Hibernate with PostgreSQL server.
On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0025) to the normalized speed of Hibernate with PostgreSQL database server (5.2) reveals that in that case, OpenJPA with HSQLDB embedded is 2,080 times slower than Hibernate with PostgreSQL server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 2.8 | 55.5 | 0.91 | 6.1 | 1.9 | 30.8 |
Element Collection Test | 1.4 | 11.0 | 0.95 | 0.016 | 1.2 | 5.5 |
Inheritance Test | 2.4 | 52.3 | 1.3 | 8.7 | 1.8 | 30.5 |
Indexing Test | 15.4 | 0.050 | 34.3 | 8.8 | 24.9 | 4.4 |
Multithreading Test | 1.4 | 55.2 | 0.53 | 9.2 | 0.95 | 32.2 |
All Tests | 4.7 | 34.8 | 7.6 | 6.6 | 6.1 | 20.7 |
The results above show that in general Hibernate with PostgreSQL server is much more efficient than OpenJPA with HSQLDB embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (6.1) to the normalized speed of Hibernate with PostgreSQL database server (20.7) reveals that in these tests, Hibernate with PostgreSQL server is 3.4 times faster than OpenJPA with HSQLDB embedded.
A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of Hibernate with PostgreSQL database server (55.2) reveals that in that case, Hibernate with PostgreSQL server is 39.4 times faster than OpenJPA 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 OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, Hibernate with PostgreSQL server is 308 times slower than OpenJPA with HSQLDB embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 12.0 | 5.3 | 5.3 | 2.7 | 8.6 | 4.0 |
Element Collection Test | 0.017 | 0.067 | 3.7 | 0.026 | 1.8 | 0.046 |
Inheritance Test | 0.0098 | 5.4 | 2.0 | 3.8 | 0.99 | 4.6 |
Indexing Test | 9.3 | 5.4 | 5.5 | 4.3 | 7.4 | 4.8 |
Graph (Binary Tree) Test | 2.5 | 1.1 | 1.6 | 0.58 | 2.1 | 0.82 |
Multithreading Test | 20.0 | 29.6 | 3.7 | 6.3 | 11.8 | 18.0 |
All Tests | 7.3 | 7.8 | 3.6 | 2.9 | 5.5 | 5.4 |
The results above show that in general OpenJPA with HSQLDB embedded is slightly more efficient than Hibernate 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 Hibernate with PostgreSQL database server (0.026) to the normalized speed of OpenJPA with HSQLDB embedded database (3.7) reveals that in that case, OpenJPA with HSQLDB embedded is 142 times faster than Hibernate with PostgreSQL server.
On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of Hibernate with PostgreSQL database server (5.4) reveals that in that case, OpenJPA with HSQLDB embedded is 551 times slower than Hibernate with PostgreSQL server.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 21.3 | 5.3 | 15.7 | 4.2 | 18.5 | 4.8 |
Element Collection Test | 0.011 | 0.020 | 2.9 | stopped | 1.5 | 0.0098 |
Inheritance Test | 0.0070 | 5.1 | 3.5 | 4.2 | 1.8 | 4.6 |
Indexing Test | 28.8 | 9.5 | 15.2 | 6.3 | 22.0 | 7.9 |
Graph (Binary Tree) Test | 2.9 | 0.012 | 3.6 | 0.012 | 3.2 | 0.012 |
Multithreading Test | 26.0 | 23.3 | 19.6 | 21.8 | 22.8 | 22.5 |
All Tests | 13.2 | 7.2 | 10.1 | 6.1 | 11.6 | 6.6 |
The results above show that in general OpenJPA with HSQLDB embedded is more efficient than Hibernate 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 Hibernate with PostgreSQL database server (0.012) to the normalized speed of OpenJPA with HSQLDB embedded database (3.6) reveals that in that case, OpenJPA with HSQLDB embedded is 300 times faster than Hibernate with PostgreSQL server.
On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0070) to the normalized speed of Hibernate with PostgreSQL database server (5.1) reveals that in that case, OpenJPA with HSQLDB embedded is 729 times slower than Hibernate 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 HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server | OpenJPA HSQLDB embedded | Hibernate PostgreSQL server |
Basic Person Test | 14.3 | 15.7 | 11.8 | 5.6 | 13.0 | 10.7 |
Element Collection Test | 2.0 | 2.8 | 3.5 | 0.35 | 2.7 | 1.6 |
Inheritance Test | 2.9 | 15.0 | 2.9 | 6.9 | 2.9 | 10.9 |
Indexing Test | 18.5 | 5.8 | 21.6 | 7.8 | 20.0 | 6.8 |
Graph (Binary Tree) Test | 3.4 | 1.2 | 3.7 | 1.1 | 3.5 | 1.1 |
Multithreading Test | 19.0 | 30.2 | 10.9 | 13.6 | 14.9 | 21.9 |
All Tests | 10.2 | 12.1 | 9.2 | 6.0 | 9.7 | 9.1 |
The results above show that in general OpenJPA with HSQLDB embedded is slightly 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 OpenJPA with HSQLDB embedded database (3.5) reveals that in that case, OpenJPA with HSQLDB embedded is 10.0 times faster than Hibernate with PostgreSQL server.
On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (2.9) to the normalized speed of Hibernate with PostgreSQL database server (15.0) reveals that in that case, OpenJPA with HSQLDB embedded is 5.2 times slower than Hibernate with PostgreSQL server.
Other Head to Head DBMS/JPA Comparisons
OpenJPA with HSQLDB 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 H2 embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server
Hibernate 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
- 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
- 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