Comparison of Hibernate with SQLite embedded vs OpenJPA 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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 0.083 | 17.1 | 1.0 | 5.8 | 0.55 | 11.5 |
Element Collection Test | 0.067 | 10.9 | 0.69 | 4.9 | 0.38 | 7.9 |
Inheritance Test | 0.080 | 14.3 | 0.99 | 5.9 | 0.54 | 10.1 |
Indexing Test | 0.098 | 24.4 | 1.0 | 13.7 | 0.55 | 19.1 |
Graph (Binary Tree) Test | 0.27 | 6.8 | 0.96 | 6.7 | 0.61 | 6.7 |
Multithreading Test | failed | 34.2 | failed | 10.2 | failed | 22.2 |
All Tests | 0.12 | 17.9 | 0.93 | 7.9 | 0.53 | 12.9 |
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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 1.8 | 14.6 | 1.3 | 27.2 | 1.5 | 20.9 |
Element Collection Test | 0.0008 | 0.0046 | failed | 4.3 | 0.0008 | 2.1 |
Inheritance Test | 2.4 | 0.011 | 1.4 | 7.4 | 1.9 | 3.7 |
Indexing Test | 1.9 | 17.0 | 2.3 | 35.0 | 2.1 | 26.0 |
Graph (Binary Tree) Test | 0.56 | 1.0 | 0.88 | 1.4 | 0.72 | 1.2 |
Multithreading Test | failed | 18.7 | failed | 27.6 | failed | 23.1 |
All Tests | 1.3 | 8.6 | 1.5 | 17.1 | 1.4 | 12.8 |
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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 1.1 | 5.0 | 0.22 | 1.1 | 0.65 | 3.1 |
Element Collection Test | 0.39 | 1.7 | failed | 1.3 | 0.39 | 1.5 |
Inheritance Test | 0.53 | 2.2 | 0.28 | 1.2 | 0.40 | 1.7 |
Indexing Test | 0.0011 | 13.8 | 0.43 | 23.2 | 0.21 | 18.5 |
Multithreading Test | failed | 1.4 | failed | 0.60 | failed | 0.99 |
All Tests | 0.50 | 4.8 | 0.31 | 5.5 | 0.42 | 5.1 |
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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 0.076 | 10.0 | 0.65 | 6.0 | 0.37 | 8.0 |
Element Collection Test | 0.0022 | 0.011 | failed | 3.8 | 0.0022 | 1.9 |
Inheritance Test | 0.079 | 0.046 | 0.97 | 5.0 | 0.53 | 2.5 |
Indexing Test | 0.057 | 8.9 | 0.54 | 7.0 | 0.30 | 8.0 |
Graph (Binary Tree) Test | 0.26 | 2.4 | 0.42 | 1.3 | 0.34 | 1.9 |
Multithreading Test | failed | 16.6 | failed | 4.3 | failed | 10.4 |
All Tests | 0.094 | 6.3 | 0.65 | 4.6 | 0.34 | 5.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 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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 0.061 | 18.3 | 0.91 | 11.1 | 0.49 | 14.7 |
Element Collection Test | 0.0007 | 0.012 | failed | 2.9 | 0.0007 | 1.4 |
Inheritance Test | 0.058 | 0.030 | 0.90 | 6.6 | 0.48 | 3.3 |
Indexing Test | 0.079 | 23.2 | 0.54 | 9.7 | 0.31 | 16.4 |
Graph (Binary Tree) Test | 0.24 | 1.8 | 0.80 | 2.4 | 0.52 | 2.1 |
Multithreading Test | failed | 31.2 | failed | 17.3 | failed | 24.2 |
All Tests | 0.088 | 12.4 | 0.79 | 8.3 | 0.40 | 10.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 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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 90.2 | 27.0 | 90.2 | 27.0 | 90.2 | 27.0 |
Element Collection Test | 82.0 | 30.6 | 82.0 | 30.6 | 82.0 | 30.6 |
Inheritance Test | 80.5 | 27.0 | 80.5 | 27.0 | 80.5 | 27.0 |
Indexing Test | 93.4 | 31.6 | 94.8 | 32.1 | 94.1 | 31.9 |
Graph (Binary Tree) Test | 67.9 | 28.5 | 50.9 | 21.4 | 59.4 | 24.9 |
Multithreading Test | failed | 33.9 | failed | 9.2 | failed | 21.5 |
All Tests | 82.8 | 29.8 | 79.7 | 24.5 | 81.2 | 27.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 | |||
---|---|---|---|---|---|---|
  | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded | Hibernate SQLite embedded | OpenJPA H2 embedded |
Basic Person Test | 0.63 | 13.0 | 0.81 | 10.2 | 0.72 | 11.6 |
Element Collection Test | 0.092 | 2.5 | 0.69 | 3.4 | 0.19 | 3.0 |
Inheritance Test | 0.63 | 3.3 | 0.91 | 5.2 | 0.77 | 4.3 |
Indexing Test | 0.42 | 17.5 | 0.96 | 17.7 | 0.69 | 17.6 |
Graph (Binary Tree) Test | 0.33 | 3.0 | 0.77 | 3.0 | 0.55 | 3.0 |
Multithreading Test | failed | 20.4 | failed | 12.0 | failed | 16.2 |
All Tests | 0.42 | 10.2 | 0.86 | 8.8 | 0.62 | 9.5 |
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
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
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