Compare with

Comparison of Hibernate with SQLite embedded vs OpenJPA with HSQLDB 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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test0.08313.31.06.90.5510.1
Element Collection Test0.0678.60.695.30.387.0
Inheritance Test0.08012.20.995.80.549.0
Indexing Test0.09816.71.09.10.5512.9
Graph (Binary Tree) Test0.276.10.967.30.616.7
Multithreading Testfailed26.8failed7.0failed16.9
All Tests0.1213.90.936.90.5310.4

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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test1.821.81.330.11.525.9
Element Collection Test0.00080.0068failed4.50.00082.2
Inheritance Test2.40.00251.42.01.90.98
Indexing Test1.922.12.343.62.132.9
Graph (Binary Tree) Test0.562.10.882.10.722.1
Multithreading Testfailed20.9failed23.5failed22.2
All Tests1.311.11.517.61.414.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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test1.12.80.220.910.651.9
Element Collection Test0.391.4failed0.950.391.2
Inheritance Test0.532.40.281.30.401.8
Indexing Test0.001115.40.4334.30.2124.9
Multithreading Testfailed1.4failed0.53failed0.95
All Tests0.504.70.317.60.426.1

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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test0.07612.00.655.30.378.6
Element Collection Test0.00220.017failed3.70.00221.8
Inheritance Test0.0790.00980.972.00.530.99
Indexing Test0.0579.30.545.50.307.4
Graph (Binary Tree) Test0.262.50.421.60.342.1
Multithreading Testfailed20.0failed3.7failed11.8
All Tests0.0947.30.653.60.345.5

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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test0.06121.30.9115.70.4918.5
Element Collection Test0.00070.011failed2.90.00071.5
Inheritance Test0.0580.00700.903.50.481.8
Indexing Test0.07928.80.5415.20.3122.0
Graph (Binary Tree) Test0.242.90.803.60.523.2
Multithreading Testfailed26.0failed19.6failed22.8
All Tests0.08813.20.7910.10.4011.6

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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test90.241.490.241.490.241.4
Element Collection Test82.046.982.046.982.046.9
Inheritance Test80.541.480.541.480.541.4
Indexing Test93.448.494.849.294.148.8
Graph (Binary Tree) Test67.928.550.921.459.425.0
Multithreading Testfailed51.9failed10.3failed31.1
All Tests82.843.179.735.181.239.1

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
 Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Hibernate
SQLite embedded
OpenJPA
HSQLDB embedded
Basic Person Test0.6314.30.8111.80.7213.0
Element Collection Test0.0922.00.693.50.192.7
Inheritance Test0.632.90.912.90.772.9
Indexing Test0.4218.50.9621.60.6920.0
Graph (Binary Tree) Test0.333.40.773.70.553.5
Multithreading Testfailed19.0failed10.9failed14.9
All Tests0.4210.20.869.20.629.7

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