Compare with

Comparison of OpenJPA with HSQLDB embedded vs OpenJPA with H2 server

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
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test13.33.76.92.210.12.9
Element Collection Test8.62.65.31.57.02.1
Inheritance Test12.24.55.82.09.03.2
Indexing Test16.77.39.13.612.95.4
Graph (Binary Tree) Test6.11.17.30.846.70.97
Multithreading Test26.87.77.04.216.95.9
All Tests13.94.56.92.410.43.4

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than OpenJPA with H2 server in persisting JPA entity objects to the database. Comparing the normalized speed of OpenJPA with H2 database server (3.4) to the normalized speed of OpenJPA with HSQLDB embedded database (10.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.1 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.84) to the normalized speed of OpenJPA with HSQLDB embedded database (7.3) reveals that in that case, OpenJPA with HSQLDB embedded is 8.7 times faster than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test21.82.930.17.625.95.2
Element Collection Test0.00680.00224.51.92.20.93
Inheritance Test0.00250.0132.04.00.982.0
Indexing Test22.14.143.68.832.96.5
Graph (Binary Tree) Test2.10.382.10.492.10.44
Multithreading Test20.95.923.514.022.210.0
All Tests11.12.217.66.114.44.2

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than OpenJPA with H2 server in retrieving JPA entity objects from the database. Comparing the normalized speed of OpenJPA with H2 database server (4.2) to the normalized speed of OpenJPA with HSQLDB embedded database (14.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.4 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (2.9) to the normalized speed of OpenJPA with HSQLDB embedded database (21.8) reveals that in that case, OpenJPA with HSQLDB embedded is 7.5 times faster than OpenJPA with H2 server.

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 OpenJPA with H2 database server (0.013) reveals that in that case, OpenJPA with HSQLDB embedded is 5.2 times slower than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test2.83.70.911.01.92.4
Element Collection Test1.42.00.951.21.21.6
Inheritance Test2.42.81.31.11.82.0
Indexing Test15.43.834.37.524.95.7
Multithreading Test1.40.980.531.00.951.0
All Tests4.72.77.62.46.12.5

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than OpenJPA with H2 server in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 database server (2.5) to the normalized speed of OpenJPA with HSQLDB embedded database (6.1) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.4 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using database indexes with large retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (7.5) to the normalized speed of OpenJPA with HSQLDB embedded database (34.3) reveals that in that case, OpenJPA with HSQLDB embedded is 4.6 times faster than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test12.03.05.32.08.62.5
Element Collection Test0.0170.00783.71.91.80.94
Inheritance Test0.00980.0342.02.80.991.4
Indexing Test9.32.85.53.27.43.0
Graph (Binary Tree) Test2.50.791.60.432.10.61
Multithreading Test20.07.03.72.511.84.8
All Tests7.32.33.62.15.52.2

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than OpenJPA with H2 server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with H2 database server (2.2) to the normalized speed of OpenJPA with HSQLDB embedded database (5.5) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.5 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (3.0) to the normalized speed of OpenJPA with HSQLDB embedded database (12.0) reveals that in that case, OpenJPA with HSQLDB embedded is 4.0 times faster than OpenJPA with H2 server.

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 OpenJPA with H2 database server (0.034) reveals that in that case, OpenJPA with HSQLDB embedded is 3.5 times slower than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test21.33.215.72.218.52.7
Element Collection Test0.0110.00602.90.881.50.44
Inheritance Test0.00700.0303.53.11.81.6
Indexing Test28.86.515.23.622.05.1
Graph (Binary Tree) Test2.90.733.60.753.20.74
Multithreading Test26.07.619.65.222.86.4
All Tests13.23.010.12.611.62.8

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than OpenJPA with H2 server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with H2 database server (2.8) to the normalized speed of OpenJPA with HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 4.1 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of OpenJPA with H2 database server (2.2) to the normalized speed of OpenJPA with HSQLDB embedded database (15.7) reveals that in that case, OpenJPA with HSQLDB embedded is 7.1 times faster than OpenJPA with H2 server.

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 OpenJPA with H2 database server (0.030) reveals that in that case, OpenJPA with HSQLDB embedded is 4.3 times slower than OpenJPA with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
OpenJPA
HSQLDB embedded
OpenJPA
H2 server
Basic Person Test14.33.311.83.013.03.1
Element Collection Test2.00.933.51.52.71.2
Inheritance Test2.91.52.92.62.92.0
Indexing Test18.54.921.65.420.05.1
Graph (Binary Tree) Test3.40.753.70.633.50.69
Multithreading Test19.05.910.95.414.95.6
All Tests10.22.99.23.29.73.0

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than OpenJPA with H2 server in performing JPA database operations. Comparing the normalized speed of OpenJPA with H2 database server (3.0) to the normalized speed of OpenJPA with HSQLDB embedded database (9.7) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.2 times faster than OpenJPA with H2 server.

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.63) to the normalized speed of OpenJPA with HSQLDB embedded database (3.7) reveals that in that case, OpenJPA with HSQLDB embedded is 5.9 times faster than OpenJPA with H2 server.

Other Head to Head DBMS/JPA Comparisons