Compare with

Comparison of OpenJPA with HSQLDB 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 EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test13.30.0836.91.010.10.55
Element Collection Test8.60.0675.30.697.00.38
Inheritance Test12.20.0805.80.999.00.54
Indexing Test16.70.0989.11.012.90.55
Graph (Binary Tree) Test6.10.277.30.966.70.61
Multithreading Test26.8failed7.0failed16.9failed
All Tests13.90.126.90.9310.40.53

Hibernate with SQLite embedded has failed in 2 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (10.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 19.6 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 HSQLDB embedded database (16.7) reveals that in that case, OpenJPA with HSQLDB embedded is 170 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test21.81.830.11.325.91.5
Element Collection Test0.00680.00084.5failed2.20.0008
Inheritance Test0.00252.42.01.40.981.9
Indexing Test22.11.943.62.332.92.1
Graph (Binary Tree) Test2.10.562.10.882.10.72
Multithreading Test20.9failed23.5failed22.2failed
All Tests11.11.317.61.514.41.4

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (14.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 10.3 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 HSQLDB embedded database (30.1) reveals that in that case, OpenJPA with HSQLDB embedded is 23.2 times faster than Hibernate with SQLite embedded.

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 SQLite embedded database (2.4) reveals that in that case, OpenJPA with HSQLDB embedded is 960 times slower than Hibernate with SQLite embedded.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test2.81.10.910.221.90.65
Element Collection Test1.40.390.95failed1.20.39
Inheritance Test2.40.531.30.281.80.40
Indexing Test15.40.001134.30.4324.90.21
Multithreading Test1.4failed0.53failed0.95failed
All Tests4.70.507.60.316.10.42

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (6.1) reveals that in these tests, OpenJPA with HSQLDB embedded is 14.5 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 HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with HSQLDB embedded is 14,000 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test12.00.0765.30.658.60.37
Element Collection Test0.0170.00223.7failed1.80.0022
Inheritance Test0.00980.0792.00.970.990.53
Indexing Test9.30.0575.50.547.40.30
Graph (Binary Tree) Test2.50.261.60.422.10.34
Multithreading Test20.0failed3.7failed11.8failed
All Tests7.30.0943.60.655.50.34

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (5.5) reveals that in these tests, OpenJPA with HSQLDB embedded is 16.2 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 HSQLDB embedded database (9.3) reveals that in that case, OpenJPA with HSQLDB embedded is 163 times faster than Hibernate with SQLite embedded.

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 SQLite embedded database (0.079) reveals that in that case, OpenJPA with HSQLDB embedded is 8.1 times slower than Hibernate with SQLite embedded.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test21.30.06115.70.9118.50.49
Element Collection Test0.0110.00072.9failed1.50.0007
Inheritance Test0.00700.0583.50.901.80.48
Indexing Test28.80.07915.20.5422.00.31
Graph (Binary Tree) Test2.90.243.60.803.20.52
Multithreading Test26.0failed19.6failed22.8failed
All Tests13.20.08810.10.7911.60.40

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 29.0 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 HSQLDB embedded database (28.8) reveals that in that case, OpenJPA with HSQLDB embedded is 365 times faster than Hibernate with SQLite embedded.

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 SQLite embedded database (0.058) reveals that in that case, OpenJPA with HSQLDB embedded is 8.3 times slower than Hibernate with SQLite embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test41.490.241.490.241.490.2
Element Collection Test46.982.046.982.046.982.0
Inheritance Test41.480.541.480.541.480.5
Indexing Test48.493.449.294.848.894.1
Graph (Binary Tree) Test28.567.921.450.925.059.4
Multithreading Test51.9failed10.3failed31.1failed
All Tests43.182.835.179.739.181.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 HSQLDB embedded in using disk space. Comparing the normalized score of OpenJPA with HSQLDB embedded database (39.1) to the normalized score of Hibernate with SQLite embedded database (81.2) reveals that in these tests, Hibernate with SQLite embedded is 2.1 times more efficient than OpenJPA with HSQLDB embedded.

A large gap has been detected when using graphs of objects with small transaction size. Comparing the normalized score of OpenJPA with HSQLDB embedded database (28.5) to the normalized score of Hibernate with SQLite embedded database (67.9) reveals that in that case, Hibernate with SQLite embedded is 2.4 times more efficient than OpenJPA with HSQLDB embedded.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
Basic Person Test14.30.6311.80.8113.00.72
Element Collection Test2.00.0923.50.692.70.19
Inheritance Test2.90.632.90.912.90.77
Indexing Test18.50.4221.60.9620.00.69
Graph (Binary Tree) Test3.40.333.70.773.50.55
Multithreading Test19.0failed10.9failed14.9failed
All Tests10.20.429.20.869.70.62

The results above show that in general OpenJPA with HSQLDB 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 HSQLDB embedded database (9.7) reveals that in these tests, OpenJPA with HSQLDB embedded is 15.6 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 HSQLDB embedded database (18.5) reveals that in that case, OpenJPA with HSQLDB embedded is 44.0 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons