Compare with

Comparison of EclipseLink with HSQLDB 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 EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test27.117.117.25.822.211.5
Element Collection Test17.210.98.24.912.77.9
Inheritance Test26.714.311.95.919.310.1
Indexing Test30.624.418.613.724.619.1
Graph (Binary Tree) Test20.06.815.96.718.06.7
Multithreading Test32.534.211.410.222.022.2
All Tests25.717.913.97.919.812.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test24.414.636.027.230.220.9
Element Collection Test14.90.004619.14.317.02.1
Inheritance Test22.80.01140.07.431.43.7
Indexing Test20.717.038.735.029.726.0
Graph (Binary Tree) Test8.71.014.21.411.41.2
Multithreading Test24.218.728.027.626.123.1
All Tests19.38.629.317.124.312.8

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.0046) to the normalized speed of EclipseLink with HSQLDB embedded database (14.9) reveals that in that case, EclipseLink with HSQLDB embedded is 3,239 times faster than OpenJPA with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test2.95.00.881.11.93.1
Element Collection Test3.21.71.41.32.31.5
Inheritance Test2.62.21.11.21.91.7
Indexing Test21.513.833.323.227.418.5
Multithreading Test1.11.40.520.600.820.99
All Tests6.34.87.45.56.95.1

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded in executing the tested JPA queries.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test17.910.07.06.012.58.0
Element Collection Test14.60.0118.33.811.41.9
Inheritance Test16.20.0469.75.013.02.5
Indexing Test12.08.96.87.09.48.0
Graph (Binary Tree) Test4.72.43.41.34.01.9
Multithreading Test24.416.64.44.314.410.4
All Tests15.06.36.64.610.85.4

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of EclipseLink with HSQLDB embedded database (14.6) reveals that in that case, EclipseLink with HSQLDB embedded is 1,327 times faster than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test32.318.320.311.126.314.7
Element Collection Test14.30.0126.02.910.21.4
Inheritance Test29.20.03023.96.626.63.3
Indexing Test55.323.227.19.741.216.4
Graph (Binary Tree) Test6.81.814.12.410.42.1
Multithreading Test52.931.228.417.340.624.2
All Tests31.812.420.08.325.910.4

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.012) to the normalized speed of EclipseLink with HSQLDB embedded database (14.3) reveals that in that case, EclipseLink with HSQLDB embedded is 1,192 times faster than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test41.427.041.427.041.427.0
Element Collection Test46.930.646.930.646.930.6
Inheritance Test41.427.041.427.041.427.0
Indexing Test48.431.649.232.148.831.9
Graph (Binary Tree) Test28.528.521.421.425.024.9
Multithreading Test51.933.910.39.231.121.5
All Tests43.129.835.124.539.127.2

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded in using disk space.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
EclipseLink
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test20.913.016.310.218.611.6
Element Collection Test12.82.58.63.410.73.0
Inheritance Test19.53.317.35.218.44.3
Indexing Test28.017.524.917.726.517.6
Graph (Binary Tree) Test10.03.011.93.011.03.0
Multithreading Test27.020.414.612.020.816.2
All Tests20.110.215.78.817.99.5

The results above show that in general EclipseLink with HSQLDB embedded is more efficient than OpenJPA with H2 embedded in performing JPA database operations.

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (3.3) to the normalized speed of EclipseLink with HSQLDB embedded database (19.5) reveals that in that case, EclipseLink with HSQLDB embedded is 5.9 times faster than OpenJPA with H2 embedded.

Other Head to Head DBMS/JPA Comparisons