Compare with

Comparison of EclipseLink with H2 server vs OpenJPA 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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test5.64.82.52.94.03.9
Element Collection Test4.22.81.51.92.82.4
Inheritance Test6.64.12.12.44.43.3
Indexing Test9.76.14.14.16.95.1
Graph (Binary Tree) Test4.71.53.51.44.11.4
Multithreading Test10.28.74.03.37.16.0
All Tests6.84.72.92.74.93.7

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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test5.514.88.222.66.818.7
Element Collection Test3.20.00314.22.33.71.2
Inheritance Test4.70.01510.17.07.43.5
Indexing Test4.411.79.426.56.919.1
Graph (Binary Tree) Test1.10.931.91.21.51.1
Multithreading Test12.225.215.928.614.026.9
All Tests5.28.88.314.76.711.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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test3.849.71.19.92.529.8
Element Collection Test4.12.71.19.62.66.1
Inheritance Test3.22.31.31.32.31.8
Indexing Test3.07.08.017.15.512.1
Multithreading Test1.140.91.011.71.126.3
All Tests3.020.52.59.92.815.2

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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test4.55.62.25.23.45.4
Element Collection Test3.80.00902.42.23.11.1
Inheritance Test4.40.0453.04.63.72.3
Indexing Test4.26.13.18.73.77.4
Graph (Binary Tree) Test1.41.60.790.911.11.3
Multithreading Test7.818.32.54.55.111.4
All Tests4.35.32.34.43.34.8

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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test6.44.23.14.54.84.3
Element Collection Test3.00.00711.31.62.20.80
Inheritance Test5.60.0352.83.04.21.5
Indexing Test10.35.33.83.67.04.4
Graph (Binary Tree) Test1.50.801.30.931.40.86
Multithreading Test7.05.74.96.26.06.0
All Tests5.62.72.93.34.33.0

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
 EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
EclipseLink
H2 server
OpenJPA
Derby embedded
Basic Person Test5.215.83.49.04.312.4
Element Collection Test3.61.12.13.52.92.3
Inheritance Test4.91.33.93.74.42.5
Indexing Test6.37.25.712.06.09.6
Graph (Binary Tree) Test2.11.21.91.12.01.2
Multithreading Test7.719.85.710.96.715.3
All Tests5.18.03.86.94.57.4

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