Compare with

Comparison of OpenJPA with H2 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
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test17.15.65.82.511.54.0
Element Collection Test10.94.24.91.57.92.8
Inheritance Test14.36.65.92.110.14.4
Indexing Test24.49.713.74.119.16.9
Graph (Binary Tree) Test6.84.76.73.56.74.1
Multithreading Test34.210.210.24.022.27.1
All Tests17.96.87.92.912.94.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test14.65.527.28.220.96.8
Element Collection Test0.00463.24.34.22.13.7
Inheritance Test0.0114.77.410.13.77.4
Indexing Test17.04.435.09.426.06.9
Graph (Binary Tree) Test1.01.11.41.91.21.5
Multithreading Test18.712.227.615.923.114.0
All Tests8.65.217.18.312.86.7

The results above show that in general OpenJPA with H2 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 small retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (4.4) to the normalized speed of OpenJPA with H2 embedded database (17.0) reveals that in that case, OpenJPA with H2 embedded is 3.9 times faster than EclipseLink with H2 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 H2 database server (3.2) reveals that in that case, OpenJPA with H2 embedded is 696 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
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test5.03.81.11.13.12.5
Element Collection Test1.74.11.31.11.52.6
Inheritance Test2.23.21.21.31.72.3
Indexing Test13.83.023.28.018.55.5
Multithreading Test1.41.10.601.00.991.1
All Tests4.83.05.52.55.12.8

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

A large performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (3.0) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, OpenJPA with H2 embedded is 4.6 times faster than EclipseLink with H2 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 (1.7) to the normalized speed of EclipseLink with H2 database server (4.1) reveals that in that case, OpenJPA with H2 embedded is 2.4 times slower than EclipseLink with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test10.04.56.02.28.03.4
Element Collection Test0.0113.83.82.41.93.1
Inheritance Test0.0464.45.03.02.53.7
Indexing Test8.94.27.03.18.03.7
Graph (Binary Tree) Test2.41.41.30.791.91.1
Multithreading Test16.67.84.32.510.45.1
All Tests6.34.34.62.35.43.3

The results above show that in general OpenJPA with H2 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 simple basic entities with large transaction size. Comparing the normalized speed of EclipseLink with H2 database server (2.2) to the normalized speed of OpenJPA with H2 embedded database (6.0) reveals that in that case, OpenJPA with H2 embedded is 2.7 times faster than EclipseLink with H2 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 H2 database server (3.8) reveals that in that case, OpenJPA with H2 embedded is 345 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
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test18.36.411.13.114.74.8
Element Collection Test0.0123.02.91.31.42.2
Inheritance Test0.0305.66.62.83.34.2
Indexing Test23.210.39.73.816.47.0
Graph (Binary Tree) Test1.81.52.41.32.11.4
Multithreading Test31.27.017.34.924.26.0
All Tests12.45.68.32.910.44.3

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with H2 database server (7.0) to the normalized speed of OpenJPA with H2 embedded database (31.2) reveals that in that case, OpenJPA with H2 embedded is 4.5 times faster than EclipseLink with H2 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.012) to the normalized speed of EclipseLink with H2 database server (3.0) reveals that in that case, OpenJPA with H2 embedded is 250 times slower than EclipseLink with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
OpenJPA
H2 embedded
EclipseLink
H2 server
Basic Person Test13.05.210.23.411.64.3
Element Collection Test2.53.63.42.13.02.9
Inheritance Test3.34.95.23.94.34.4
Indexing Test17.56.317.75.717.66.0
Graph (Binary Tree) Test3.02.13.01.93.02.0
Multithreading Test20.47.712.05.716.26.7
All Tests10.25.18.83.89.54.5

The results above show that in general OpenJPA with H2 embedded is more efficient than EclipseLink with H2 server in performing JPA database operations. Comparing the normalized speed of EclipseLink with H2 database server (4.5) to the normalized speed of OpenJPA with H2 embedded database (9.5) reveals that in these tests, OpenJPA with H2 embedded is 2.1 times faster than EclipseLink with H2 server.

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

Other Head to Head DBMS/JPA Comparisons