Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink with Derby 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
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test17.13.85.83.111.53.4
Element Collection Test10.92.24.91.57.91.8
Inheritance Test14.33.95.92.910.13.4
Indexing Test24.45.213.74.319.14.7
Graph (Binary Tree) Test6.81.96.71.76.71.8
Multithreading Test34.26.110.23.922.25.0
All Tests17.93.87.92.912.93.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test14.66.427.211.320.98.8
Element Collection Test0.00461.84.32.42.12.1
Inheritance Test0.0113.77.412.93.78.3
Indexing Test17.03.635.012.826.08.2
Graph (Binary Tree) Test1.00.611.40.731.20.67
Multithreading Test18.78.527.619.823.114.1
All Tests8.64.117.110.012.87.0

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

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test5.045.81.15.33.125.6
Element Collection Test1.735.21.30.991.518.1
Inheritance Test2.223.11.25.91.714.5
Indexing Test13.82.523.212.218.57.4
Multithreading Test1.434.30.607.70.9921.0
All Tests4.828.25.56.45.117.3

The results above show that in general EclipseLink with Derby server 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 database server (17.3) reveals that in these tests, EclipseLink with Derby server is 3.4 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 database server (34.3) reveals that in that case, EclipseLink with Derby server is 24.5 times faster than OpenJPA with H2 embedded.

On the other hand, EclipseLink with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with Derby database server (2.5) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, EclipseLink with Derby server is 5.5 times slower 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 server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test10.03.96.04.48.04.1
Element Collection Test0.0111.73.81.61.91.6
Inheritance Test0.0464.65.06.12.55.3
Indexing Test8.94.57.07.68.06.1
Graph (Binary Tree) Test2.40.701.30.421.90.56
Multithreading Test16.67.34.34.810.46.0
All Tests6.33.84.64.25.44.0

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of EclipseLink with Derby database server (0.70) to the normalized speed of OpenJPA with H2 embedded database (2.4) reveals that in that case, OpenJPA with H2 embedded is 3.4 times faster than EclipseLink with Derby server.

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.011) to the normalized speed of EclipseLink with Derby database server (1.7) reveals that in that case, OpenJPA with H2 embedded is 155 times slower than EclipseLink with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test18.32.811.13.914.73.3
Element Collection Test0.0121.22.90.551.40.87
Inheritance Test0.0303.36.63.73.33.5
Indexing Test23.24.99.73.516.44.2
Graph (Binary Tree) Test1.80.512.40.502.10.51
Multithreading Test31.24.817.35.724.25.3
All Tests12.42.98.33.010.43.0

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

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

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.030) to the normalized speed of EclipseLink with Derby database server (3.3) reveals that in that case, OpenJPA with H2 embedded is 110 times slower than EclipseLink with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
OpenJPA
H2 embedded
EclipseLink
Derby server
Basic Person Test13.012.510.25.611.69.1
Element Collection Test2.58.43.41.43.04.9
Inheritance Test3.37.75.26.34.37.0
Indexing Test17.54.117.78.117.66.1
Graph (Binary Tree) Test3.00.933.00.833.00.88
Multithreading Test20.412.212.08.416.210.3
All Tests10.27.98.85.29.56.6

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

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

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

Other Head to Head DBMS/JPA Comparisons