Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink with PostgreSQL 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
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test17.17.35.84.211.55.8
Element Collection Test10.93.14.91.97.92.5
Inheritance Test14.36.95.95.010.15.9
Indexing Test24.410.013.76.819.18.4
Graph (Binary Tree) Test6.83.56.73.36.73.4
Multithreading Test34.231.810.214.522.223.1
All Tests17.910.47.96.012.98.2

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

A large performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (3.1) to the normalized speed of OpenJPA with H2 embedded database (10.9) reveals that in that case, OpenJPA with H2 embedded is 3.5 times faster than EclipseLink with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test14.66.827.217.220.912.0
Element Collection Test0.00460.0264.30.0202.10.023
Inheritance Test0.0116.07.419.73.712.9
Indexing Test17.05.635.019.526.012.6
Graph (Binary Tree) Test1.00.471.40.611.20.54
Multithreading Test18.713.527.627.823.120.6
All Tests8.65.417.114.112.89.8

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

A huge performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.020) to the normalized speed of OpenJPA with H2 embedded database (4.3) reveals that in that case, OpenJPA with H2 embedded is 215 times faster than EclipseLink with PostgreSQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of EclipseLink with PostgreSQL database server (6.0) reveals that in that case, OpenJPA with H2 embedded is 545 times slower than EclipseLink with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test5.055.51.17.83.131.6
Element Collection Test1.715.41.30.0281.57.7
Inheritance Test2.254.91.211.51.733.2
Indexing Test13.80.07723.210.018.55.1
Multithreading Test1.455.30.6012.00.9933.7
All Tests4.836.25.58.35.122.3

The results above show that in general EclipseLink with PostgreSQL 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 PostgreSQL database server (22.3) reveals that in these tests, EclipseLink with PostgreSQL server is 4.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 PostgreSQL database server (55.3) reveals that in that case, EclipseLink with PostgreSQL server is 39.5 times faster than OpenJPA with H2 embedded.

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.077) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, EclipseLink with PostgreSQL server is 179 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
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test10.06.26.04.18.05.1
Element Collection Test0.0110.0803.80.0281.90.054
Inheritance Test0.0466.45.06.12.56.2
Indexing Test8.96.57.07.08.06.8
Graph (Binary Tree) Test2.40.901.30.501.90.70
Multithreading Test16.636.04.39.110.422.5
All Tests6.39.34.64.55.46.9

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.046) to the normalized speed of EclipseLink with PostgreSQL database server (6.4) reveals that in that case, EclipseLink with PostgreSQL server is 139 times faster than OpenJPA with H2 embedded.

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.028) to the normalized speed of OpenJPA with H2 embedded database (3.8) reveals that in that case, EclipseLink with PostgreSQL server is 136 times slower 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
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test18.35.711.15.714.75.7
Element Collection Test0.0120.0252.9stopped1.40.012
Inheritance Test0.0305.56.65.43.35.4
Indexing Test23.210.49.710.016.410.2
Graph (Binary Tree) Test1.80.0162.40.0132.10.015
Multithreading Test31.226.317.316.824.221.6
All Tests12.48.08.36.310.47.2

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.013) to the normalized speed of OpenJPA with H2 embedded database (2.4) reveals that in that case, OpenJPA with H2 embedded is 185 times faster than EclipseLink with PostgreSQL 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 PostgreSQL database server (5.5) reveals that in that case, OpenJPA with H2 embedded is 183 times slower than EclipseLink with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
OpenJPA
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test13.016.310.27.811.612.1
Element Collection Test2.53.73.40.403.02.1
Inheritance Test3.315.95.29.54.312.7
Indexing Test17.56.517.710.717.68.6
Graph (Binary Tree) Test3.01.23.01.13.01.2
Multithreading Test20.432.612.016.016.224.3
All Tests10.213.18.87.89.510.5

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

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (3.3) to the normalized speed of EclipseLink with PostgreSQL database server (15.9) reveals that in that case, EclipseLink with PostgreSQL server is 4.8 times faster than OpenJPA with H2 embedded.

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.40) to the normalized speed of OpenJPA with H2 embedded database (3.4) reveals that in that case, EclipseLink with PostgreSQL server is 8.5 times slower than OpenJPA with H2 embedded.

Other Head to Head DBMS/JPA Comparisons