Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink with Derby 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
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test17.15.55.83.711.54.6
Element Collection Test10.93.04.91.77.92.4
Inheritance Test14.35.35.93.510.14.4
Indexing Test24.46.913.74.619.15.8
Graph (Binary Tree) Test6.82.06.71.96.71.9
Multithreading Test34.29.310.24.122.26.7
All Tests17.95.37.93.212.94.3

The results above show that in general OpenJPA with H2 embedded is much more efficient than EclipseLink with Derby embedded in persisting JPA entity objects to the database. Comparing the normalized speed of EclipseLink with Derby embedded database (4.3) to the normalized speed of OpenJPA with H2 embedded database (12.9) reveals that in these tests, OpenJPA with H2 embedded is 3.0 times faster than EclipseLink with Derby embedded.

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (9.3) to the normalized speed of OpenJPA with H2 embedded database (34.2) reveals that in that case, OpenJPA with H2 embedded is 3.7 times faster than EclipseLink with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test14.616.427.258.720.937.5
Element Collection Test0.00467.54.313.32.110.4
Inheritance Test0.01117.17.458.93.738.0
Indexing Test17.014.235.067.426.040.8
Graph (Binary Tree) Test1.02.81.45.71.24.2
Multithreading Test18.728.027.648.723.138.4
All Tests8.614.317.142.112.828.2

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

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 Derby embedded database (7.5) reveals that in that case, EclipseLink with Derby embedded is 1,630 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
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test5.053.41.113.83.133.6
Element Collection Test1.737.91.34.41.521.2
Inheritance Test2.237.41.215.01.726.2
Indexing Test13.87.623.249.318.528.4
Multithreading Test1.441.20.606.10.9923.6
All Tests4.835.55.517.75.126.6

The results above show that in general EclipseLink with Derby embedded is much more efficient than OpenJPA with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 embedded database (5.1) to the normalized speed of EclipseLink with Derby embedded database (26.6) reveals that in these tests, EclipseLink with Derby embedded is 5.2 times faster than OpenJPA with H2 embedded.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (1.4) to the normalized speed of EclipseLink with Derby embedded database (41.2) reveals that in that case, EclipseLink with Derby embedded is 29.4 times faster than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test10.06.46.06.78.06.5
Element Collection Test0.0115.43.86.21.95.8
Inheritance Test0.0466.55.09.22.57.8
Indexing Test8.97.37.011.18.09.2
Graph (Binary Tree) Test2.42.81.31.71.92.2
Multithreading Test16.621.34.35.010.413.1
All Tests6.38.34.66.65.47.5

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

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 Derby embedded database (5.4) reveals that in that case, EclipseLink with Derby embedded is 491 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
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test18.34.611.14.714.74.6
Element Collection Test0.0122.52.91.41.41.9
Inheritance Test0.0303.96.64.53.34.2
Indexing Test23.26.29.73.816.45.0
Graph (Binary Tree) Test1.81.12.41.02.11.1
Multithreading Test31.26.217.35.824.26.0
All Tests12.44.18.33.510.43.8

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with Derby embedded database (6.2) to the normalized speed of OpenJPA with H2 embedded database (31.2) reveals that in that case, OpenJPA with H2 embedded is 5.0 times faster than EclipseLink with Derby embedded.

On the other hand, OpenJPA with H2 embedded is slower, for instance, 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 Derby embedded database (2.5) reveals that in that case, OpenJPA with H2 embedded is 208 times slower than EclipseLink with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test27.051.127.051.027.051.1
Element Collection Test30.638.530.639.430.638.9
Inheritance Test27.048.027.047.927.048.0
Indexing Test31.651.632.152.331.952.0
Graph (Binary Tree) Test28.513.421.411.724.912.6
Multithreading Test33.952.69.28.421.530.5
All Tests29.842.524.535.127.238.8

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

On the other hand, EclipseLink with Derby embedded is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized score of EclipseLink with Derby embedded database (13.4) to the normalized score of OpenJPA with H2 embedded database (28.5) reveals that in that case, EclipseLink with Derby embedded is 2.1 times less efficient than OpenJPA with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
OpenJPA
H2 embedded
EclipseLink
Derby embedded
Basic Person Test13.017.310.217.511.617.4
Element Collection Test2.511.33.45.43.08.3
Inheritance Test3.314.05.218.24.316.1
Indexing Test17.58.417.727.217.617.8
Graph (Binary Tree) Test3.02.23.02.63.02.4
Multithreading Test20.421.212.013.916.217.6
All Tests10.212.78.814.59.513.6

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

A large performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (2.5) to the normalized speed of EclipseLink with Derby embedded database (11.3) reveals that in that case, EclipseLink with Derby embedded is 4.5 times faster than OpenJPA with H2 embedded.

On the other hand, EclipseLink with Derby embedded is slower, for instance, when using database indexes with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with Derby embedded database (8.4) to the normalized speed of OpenJPA with H2 embedded database (17.5) reveals that in that case, EclipseLink with Derby embedded is 2.1 times slower than OpenJPA with H2 embedded.

Other Head to Head DBMS/JPA Comparisons