Comparison of OpenJPA with H2 embedded 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 H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 17.1 | 0.083 | 5.8 | 1.0 | 11.5 | 0.55 |
Element Collection Test | 10.9 | 0.067 | 4.9 | 0.69 | 7.9 | 0.38 |
Inheritance Test | 14.3 | 0.080 | 5.9 | 0.99 | 10.1 | 0.54 |
Indexing Test | 24.4 | 0.098 | 13.7 | 1.0 | 19.1 | 0.55 |
Graph (Binary Tree) Test | 6.8 | 0.27 | 6.7 | 0.96 | 6.7 | 0.61 |
Multithreading Test | 34.2 | failed | 10.2 | failed | 22.2 | failed |
All Tests | 17.9 | 0.12 | 7.9 | 0.93 | 12.9 | 0.53 |
Hibernate with SQLite embedded has failed in 2 tests (see exceptions).
The results above show that in general OpenJPA with H2 embedded 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 H2 embedded database (12.9) reveals that in these tests, OpenJPA with H2 embedded is 24.3 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 H2 embedded database (24.4) reveals that in that case, OpenJPA with H2 embedded is 249 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 H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 14.6 | 1.8 | 27.2 | 1.3 | 20.9 | 1.5 |
Element Collection Test | 0.0046 | 0.0008 | 4.3 | failed | 2.1 | 0.0008 |
Inheritance Test | 0.011 | 2.4 | 7.4 | 1.4 | 3.7 | 1.9 |
Indexing Test | 17.0 | 1.9 | 35.0 | 2.3 | 26.0 | 2.1 |
Graph (Binary Tree) Test | 1.0 | 0.56 | 1.4 | 0.88 | 1.2 | 0.72 |
Multithreading Test | 18.7 | failed | 27.6 | failed | 23.1 | failed |
All Tests | 8.6 | 1.3 | 17.1 | 1.5 | 12.8 | 1.4 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with H2 embedded 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 H2 embedded database (12.8) reveals that in these tests, OpenJPA with H2 embedded is 9.1 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using simple basic entities with large retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (1.3) to the normalized speed of OpenJPA with H2 embedded database (27.2) reveals that in that case, OpenJPA with H2 embedded is 20.9 times faster than Hibernate with SQLite embedded.
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 Hibernate with SQLite embedded database (2.4) reveals that in that case, OpenJPA with H2 embedded is 218 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 H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 5.0 | 1.1 | 1.1 | 0.22 | 3.1 | 0.65 |
Element Collection Test | 1.7 | 0.39 | 1.3 | failed | 1.5 | 0.39 |
Inheritance Test | 2.2 | 0.53 | 1.2 | 0.28 | 1.7 | 0.40 |
Indexing Test | 13.8 | 0.0011 | 23.2 | 0.43 | 18.5 | 0.21 |
Multithreading Test | 1.4 | failed | 0.60 | failed | 0.99 | failed |
All Tests | 4.8 | 0.50 | 5.5 | 0.31 | 5.1 | 0.42 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with H2 embedded is much more efficient than Hibernate with SQLite embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with H2 embedded database (5.1) reveals that in these tests, OpenJPA with H2 embedded is 12.1 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0011) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, OpenJPA with H2 embedded is 12,545 times faster than Hibernate with SQLite embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 10.0 | 0.076 | 6.0 | 0.65 | 8.0 | 0.37 |
Element Collection Test | 0.011 | 0.0022 | 3.8 | failed | 1.9 | 0.0022 |
Inheritance Test | 0.046 | 0.079 | 5.0 | 0.97 | 2.5 | 0.53 |
Indexing Test | 8.9 | 0.057 | 7.0 | 0.54 | 8.0 | 0.30 |
Graph (Binary Tree) Test | 2.4 | 0.26 | 1.3 | 0.42 | 1.9 | 0.34 |
Multithreading Test | 16.6 | failed | 4.3 | failed | 10.4 | failed |
All Tests | 6.3 | 0.094 | 4.6 | 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 H2 embedded 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 H2 embedded database (5.4) reveals that in these tests, OpenJPA with H2 embedded 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 H2 embedded database (8.9) reveals that in that case, OpenJPA with H2 embedded is 156 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 H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 18.3 | 0.061 | 11.1 | 0.91 | 14.7 | 0.49 |
Element Collection Test | 0.012 | 0.0007 | 2.9 | failed | 1.4 | 0.0007 |
Inheritance Test | 0.030 | 0.058 | 6.6 | 0.90 | 3.3 | 0.48 |
Indexing Test | 23.2 | 0.079 | 9.7 | 0.54 | 16.4 | 0.31 |
Graph (Binary Tree) Test | 1.8 | 0.24 | 2.4 | 0.80 | 2.1 | 0.52 |
Multithreading Test | 31.2 | failed | 17.3 | failed | 24.2 | failed |
All Tests | 12.4 | 0.088 | 8.3 | 0.79 | 10.4 | 0.40 |
Hibernate with SQLite embedded has failed in 3 tests (see exceptions).
The results above show that in general OpenJPA with H2 embedded 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 H2 embedded database (10.4) reveals that in these tests, OpenJPA with H2 embedded is 26.0 times faster than Hibernate with SQLite embedded.
A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.061) to the normalized speed of OpenJPA with H2 embedded database (18.3) reveals that in that case, OpenJPA with H2 embedded is 300 times faster than Hibernate with SQLite embedded.
Comparison of database storage efficiency (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 27.0 | 90.2 | 27.0 | 90.2 | 27.0 | 90.2 |
Element Collection Test | 30.6 | 82.0 | 30.6 | 82.0 | 30.6 | 82.0 |
Inheritance Test | 27.0 | 80.5 | 27.0 | 80.5 | 27.0 | 80.5 |
Indexing Test | 31.6 | 93.4 | 32.1 | 94.8 | 31.9 | 94.1 |
Graph (Binary Tree) Test | 28.5 | 67.9 | 21.4 | 50.9 | 24.9 | 59.4 |
Multithreading Test | 33.9 | failed | 9.2 | failed | 21.5 | failed |
All Tests | 29.8 | 82.8 | 24.5 | 79.7 | 27.2 | 81.2 |
Hibernate with SQLite embedded has failed in 2 tests (see exceptions).
The results above show that in general Hibernate with SQLite embedded is more efficient than OpenJPA with H2 embedded in using disk space. Comparing the normalized score of OpenJPA with H2 embedded database (27.2) to the normalized score of Hibernate with SQLite embedded database (81.2) reveals that in these tests, Hibernate with SQLite embedded is 3.0 times more efficient than OpenJPA with H2 embedded.
A large gap has been detected when using simple basic entities with small transaction size. Comparing the normalized score of OpenJPA with H2 embedded database (27.0) to the normalized score of Hibernate with SQLite embedded database (90.2) reveals that in that case, Hibernate with SQLite embedded is 3.3 times more efficient than OpenJPA with H2 embedded.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded |
Basic Person Test | 13.0 | 0.63 | 10.2 | 0.81 | 11.6 | 0.72 |
Element Collection Test | 2.5 | 0.092 | 3.4 | 0.69 | 3.0 | 0.19 |
Inheritance Test | 3.3 | 0.63 | 5.2 | 0.91 | 4.3 | 0.77 |
Indexing Test | 17.5 | 0.42 | 17.7 | 0.96 | 17.6 | 0.69 |
Graph (Binary Tree) Test | 3.0 | 0.33 | 3.0 | 0.77 | 3.0 | 0.55 |
Multithreading Test | 20.4 | failed | 12.0 | failed | 16.2 | failed |
All Tests | 10.2 | 0.42 | 8.8 | 0.86 | 9.5 | 0.62 |
The results above show that in general OpenJPA with H2 embedded 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 H2 embedded database (9.5) reveals that in these tests, OpenJPA with H2 embedded is 15.3 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 H2 embedded database (17.5) reveals that in that case, OpenJPA with H2 embedded is 41.7 times faster than Hibernate with SQLite 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
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