Compare with

Comparison of OpenJPA with Derby embedded vs EclipseLink 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
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test4.85.62.92.53.94.0
Element Collection Test2.84.21.91.52.42.8
Inheritance Test4.16.62.42.13.34.4
Indexing Test6.19.74.14.15.16.9
Graph (Binary Tree) Test1.54.71.43.51.44.1
Multithreading Test8.710.23.34.06.07.1
All Tests4.76.82.72.93.74.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test14.85.522.68.218.76.8
Element Collection Test0.00313.22.34.21.23.7
Inheritance Test0.0154.77.010.13.57.4
Indexing Test11.74.426.59.419.16.9
Graph (Binary Tree) Test0.931.11.21.91.11.5
Multithreading Test25.212.228.615.926.914.0
All Tests8.85.214.78.311.76.7

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

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

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0031) to the normalized speed of EclipseLink with H2 database server (3.2) reveals that in that case, OpenJPA with Derby embedded is 1,032 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
 OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test49.73.89.91.129.82.5
Element Collection Test2.74.19.61.16.12.6
Inheritance Test2.33.21.31.31.82.3
Indexing Test7.03.017.18.012.15.5
Multithreading Test40.91.111.71.026.31.1
All Tests20.53.09.92.515.22.8

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test5.64.55.22.25.43.4
Element Collection Test0.00903.82.22.41.13.1
Inheritance Test0.0454.44.63.02.33.7
Indexing Test6.14.28.73.17.43.7
Graph (Binary Tree) Test1.61.40.910.791.31.1
Multithreading Test18.37.84.52.511.45.1
All Tests5.34.34.42.34.83.3

The results above show that in general OpenJPA with Derby 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 database indexes with large transaction size. Comparing the normalized speed of EclipseLink with H2 database server (3.1) to the normalized speed of OpenJPA with Derby embedded database (8.7) reveals that in that case, OpenJPA with Derby embedded is 2.8 times faster than EclipseLink with H2 server.

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0090) to the normalized speed of EclipseLink with H2 database server (3.8) reveals that in that case, OpenJPA with Derby embedded is 422 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
 OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test4.26.44.53.14.34.8
Element Collection Test0.00713.01.61.30.802.2
Inheritance Test0.0355.63.02.81.54.2
Indexing Test5.310.33.63.84.47.0
Graph (Binary Tree) Test0.801.50.931.30.861.4
Multithreading Test5.77.06.24.96.06.0
All Tests2.75.63.32.93.04.3

The results above show that in general EclipseLink with H2 server is more efficient than OpenJPA with Derby embedded in deleting JPA entity objects from 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 Derby embedded database (0.0071) to the normalized speed of EclipseLink with H2 database server (3.0) reveals that in that case, EclipseLink with H2 server is 423 times faster than OpenJPA with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
Basic Person Test15.85.29.03.412.44.3
Element Collection Test1.13.63.52.12.32.9
Inheritance Test1.34.93.73.92.54.4
Indexing Test7.26.312.05.79.66.0
Graph (Binary Tree) Test1.22.11.11.91.22.0
Multithreading Test19.87.710.95.715.36.7
All Tests8.05.16.93.87.44.5

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

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

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

Other Head to Head DBMS/JPA Comparisons