Compare with

Comparison of EclipseLink with H2 server 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
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test5.613.32.56.94.010.1
Element Collection Test4.28.61.55.32.87.0
Inheritance Test6.612.22.15.84.49.0
Indexing Test9.716.74.19.16.912.9
Graph (Binary Tree) Test4.76.13.57.34.16.7
Multithreading Test10.226.84.07.07.116.9
All Tests6.813.92.96.94.910.4

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of EclipseLink with H2 database server (1.5) to the normalized speed of OpenJPA with HSQLDB embedded database (5.3) reveals that in that case, OpenJPA with HSQLDB embedded is 3.5 times faster than EclipseLink with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test5.521.88.230.16.825.9
Element Collection Test3.20.00684.24.53.72.2
Inheritance Test4.70.002510.12.07.40.98
Indexing Test4.422.19.443.66.932.9
Graph (Binary Tree) Test1.12.11.92.11.52.1
Multithreading Test12.220.915.923.514.022.2
All Tests5.211.18.317.66.714.4

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

A large performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (4.4) to the normalized speed of OpenJPA with HSQLDB embedded database (22.1) reveals that in that case, OpenJPA with HSQLDB embedded is 5.0 times faster than EclipseLink 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 EclipseLink with H2 database server (4.7) reveals that in that case, OpenJPA with HSQLDB embedded is 1,880 times slower than EclipseLink with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test3.82.81.10.912.51.9
Element Collection Test4.11.41.10.952.61.2
Inheritance Test3.22.41.31.32.31.8
Indexing Test3.015.48.034.35.524.9
Multithreading Test1.11.41.00.531.10.95
All Tests3.04.72.57.62.86.1

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

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

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of EclipseLink with H2 database server (4.1) reveals that in that case, OpenJPA with HSQLDB embedded is 2.9 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test4.512.02.25.33.48.6
Element Collection Test3.80.0172.43.73.11.8
Inheritance Test4.40.00983.02.03.70.99
Indexing Test4.29.33.15.53.77.4
Graph (Binary Tree) Test1.42.50.791.61.12.1
Multithreading Test7.820.02.53.75.111.8
All Tests4.37.32.33.63.35.5

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than EclipseLink with H2 server in updating JPA entity objects in the database.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of EclipseLink with H2 database server (4.5) to the normalized speed of OpenJPA with HSQLDB embedded database (12.0) reveals that in that case, OpenJPA with HSQLDB embedded is 2.7 times faster than EclipseLink 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 EclipseLink with H2 database server (4.4) reveals that in that case, OpenJPA with HSQLDB embedded is 449 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test6.421.33.115.74.818.5
Element Collection Test3.00.0111.32.92.21.5
Inheritance Test5.60.00702.83.54.21.8
Indexing Test10.328.83.815.27.022.0
Graph (Binary Tree) Test1.52.91.33.61.43.2
Multithreading Test7.026.04.919.66.022.8
All Tests5.613.22.910.14.311.6

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

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of EclipseLink with H2 database server (3.1) to the normalized speed of OpenJPA with HSQLDB embedded database (15.7) reveals that in that case, OpenJPA with HSQLDB embedded is 5.1 times faster than EclipseLink 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 EclipseLink with H2 database server (5.6) reveals that in that case, OpenJPA with HSQLDB embedded is 800 times slower than EclipseLink with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
EclipseLink
H2 server
OpenJPA
HSQLDB embedded
Basic Person Test5.214.33.411.84.313.0
Element Collection Test3.62.02.13.52.92.7
Inheritance Test4.92.93.92.94.42.9
Indexing Test6.318.55.721.66.020.0
Graph (Binary Tree) Test2.13.41.93.72.03.5
Multithreading Test7.719.05.710.96.714.9
All Tests5.110.23.89.24.59.7

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

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

Other Head to Head DBMS/JPA Comparisons