Comparison of OpenJPA with PostgreSQL server vs Hibernate with SQLite 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 | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | 5.2 | 0.083 | 4.8 | 1.0 | 5.0 | 0.55 |
Element Collection Test | 2.8 | 0.067 | 2.2 | 0.69 | 2.5 | 0.38 |
Inheritance Test | 4.6 | 0.080 | 3.2 | 0.99 | 3.9 | 0.54 |
Indexing Test | 7.4 | 0.098 | 6.9 | 1.0 | 7.1 | 0.55 |
Graph (Binary Tree) Test | 0.98 | 0.27 | 0.81 | 0.96 | 0.89 | 0.61 |
Multithreading Test | 23.4 | failed | 9.1 | failed | 16.2 | failed |
All Tests | 7.4 | 0.12 | 4.5 | 0.93 | 5.9 | 0.53 |
Hibernate with SQLite embedded has failed in 2 tests (see exceptions).
The results above show that in general OpenJPA with PostgreSQL server is much more efficient than Hibernate with SQLite embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of OpenJPA with PostgreSQL database server (5.9) reveals that in these tests, OpenJPA with PostgreSQL server is 11.1 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.098) to the normalized speed of OpenJPA with PostgreSQL database server (7.4) reveals that in that case, OpenJPA with PostgreSQL server is 75.5 times faster than Hibernate with SQLite embedded.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | 5.8 | 1.8 | 16.1 | 1.3 | 10.9 | 1.5 |
Element Collection Test | 0.013 | 0.0008 | 8.7 | failed | 4.4 | 0.0008 |
Inheritance Test | 5.2 | 2.4 | 17.6 | 1.4 | 11.4 | 1.9 |
Indexing Test | 4.8 | 1.9 | 18.7 | 2.3 | 11.8 | 2.1 |
Graph (Binary Tree) Test | 0.27 | 0.56 | 0.35 | 0.88 | 0.31 | 0.72 |
Multithreading Test | 11.9 | failed | 23.3 | failed | 17.6 | failed |
All Tests | 4.7 | 1.3 | 14.1 | 1.5 | 9.4 | 1.4 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with PostgreSQL server is much more efficient than Hibernate with SQLite embedded in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (1.4) to the normalized speed of OpenJPA with PostgreSQL database server (9.4) reveals that in these tests, OpenJPA with PostgreSQL server is 6.7 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0008) to the normalized speed of OpenJPA with PostgreSQL database server (0.013) reveals that in that case, OpenJPA with PostgreSQL server is 16.2 times faster than Hibernate with SQLite embedded.
On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.35) to the normalized speed of Hibernate with SQLite embedded database (0.88) reveals that in that case, OpenJPA with PostgreSQL server is 2.5 times slower than Hibernate with SQLite embedded.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | failed | 1.1 | failed | 0.22 | failed | 0.65 |
Element Collection Test | failed | 0.39 | failed | failed | failed | 0.39 |
Inheritance Test | failed | 0.53 | failed | 0.28 | failed | 0.40 |
Indexing Test | failed | 0.0011 | failed | 0.43 | failed | 0.21 |
Multithreading Test | failed | failed | failed | failed | failed | failed |
All Tests | failed | 0.50 | failed | 0.31 | failed | 0.42 |
OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions). Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | 4.9 | 0.076 | 3.9 | 0.65 | 4.4 | 0.37 |
Element Collection Test | 0.033 | 0.0022 | 4.6 | failed | 2.3 | 0.0022 |
Inheritance Test | 4.8 | 0.079 | 4.9 | 0.97 | 4.9 | 0.53 |
Indexing Test | 5.1 | 0.057 | 6.0 | 0.54 | 5.6 | 0.30 |
Graph (Binary Tree) Test | 0.57 | 0.26 | 0.31 | 0.42 | 0.44 | 0.34 |
Multithreading Test | 22.2 | failed | 7.4 | failed | 14.8 | failed |
All Tests | 6.3 | 0.094 | 4.5 | 0.65 | 5.4 | 0.34 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with PostgreSQL server is much more efficient than Hibernate with SQLite embedded in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.34) to the normalized speed of OpenJPA with PostgreSQL database server (5.4) reveals that in these tests, OpenJPA with PostgreSQL server is 15.9 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.057) to the normalized speed of OpenJPA with PostgreSQL database server (5.1) reveals that in that case, OpenJPA with PostgreSQL server is 89.5 times faster than Hibernate with SQLite embedded.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | 4.6 | 0.061 | 5.3 | 0.91 | 5.0 | 0.49 |
Element Collection Test | 0.032 | 0.0007 | 2.8 | failed | 1.4 | 0.0007 |
Inheritance Test | 4.3 | 0.058 | 4.6 | 0.90 | 4.4 | 0.48 |
Indexing Test | 8.0 | 0.079 | 7.1 | 0.54 | 7.5 | 0.31 |
Graph (Binary Tree) Test | 0.53 | 0.24 | 0.55 | 0.80 | 0.54 | 0.52 |
Multithreading Test | 17.4 | failed | 9.1 | failed | 13.3 | failed |
All Tests | 5.8 | 0.088 | 4.9 | 0.79 | 5.4 | 0.40 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with PostgreSQL server is much more efficient than Hibernate with SQLite embedded in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.40) to the normalized speed of OpenJPA with PostgreSQL database server (5.4) reveals that in these tests, OpenJPA with PostgreSQL server is 13.5 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.079) to the normalized speed of OpenJPA with PostgreSQL database server (8.0) reveals that in that case, OpenJPA with PostgreSQL server is 101 times faster than Hibernate with SQLite embedded.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded | OpenJPA PostgreSQL server | Hibernate SQLite embedded |
Basic Person Test | 5.1 | 0.63 | 7.5 | 0.81 | 6.3 | 0.72 |
Element Collection Test | 0.72 | 0.092 | 4.6 | 0.69 | 2.6 | 0.19 |
Inheritance Test | 4.7 | 0.63 | 7.6 | 0.91 | 6.2 | 0.77 |
Indexing Test | 6.3 | 0.42 | 9.7 | 0.96 | 8.0 | 0.69 |
Graph (Binary Tree) Test | 0.59 | 0.33 | 0.50 | 0.77 | 0.55 | 0.55 |
Multithreading Test | 18.7 | failed | 12.2 | failed | 15.5 | failed |
All Tests | 6.0 | 0.42 | 7.0 | 0.86 | 6.5 | 0.62 |
The results above show that in general OpenJPA with PostgreSQL server is much more efficient than Hibernate with SQLite embedded in performing JPA database operations. Comparing the normalized speed of Hibernate with SQLite embedded database (0.62) to the normalized speed of OpenJPA with PostgreSQL database server (6.5) reveals that in these tests, OpenJPA with PostgreSQL server is 10.5 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with PostgreSQL database server (6.3) reveals that in that case, OpenJPA with PostgreSQL server is 15.0 times faster than Hibernate with SQLite embedded.
Other Head to Head DBMS/JPA Comparisons
OpenJPA 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
- 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
- ObjectDB embedded
- ObjectDB server
Hibernate with SQLite 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 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