Compare with

Comparison of OpenJPA with PostgreSQL server 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
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.25.64.82.55.04.0
Element Collection Test2.84.22.21.52.52.8
Inheritance Test4.66.63.22.13.94.4
Indexing Test7.49.76.94.17.16.9
Graph (Binary Tree) Test0.984.70.813.50.894.1
Multithreading Test23.410.29.14.016.27.1
All Tests7.46.84.52.95.94.9

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

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 PostgreSQL database server (23.4) reveals that in that case, OpenJPA with PostgreSQL server is 2.3 times faster than EclipseLink with H2 server.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.98) to the normalized speed of EclipseLink with H2 database server (4.7) reveals that in that case, OpenJPA with PostgreSQL server is 4.8 times slower than EclipseLink with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.85.516.18.210.96.8
Element Collection Test0.0133.28.74.24.43.7
Inheritance Test5.24.717.610.111.47.4
Indexing Test4.84.418.79.411.86.9
Graph (Binary Tree) Test0.271.10.351.90.311.5
Multithreading Test11.912.223.315.917.614.0
All Tests4.75.214.18.39.46.7

The results above show that in general OpenJPA with PostgreSQL server 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 JPA element collections with large retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (4.2) to the normalized speed of OpenJPA with PostgreSQL database server (8.7) reveals that in that case, OpenJPA with PostgreSQL server is 2.1 times faster than EclipseLink with H2 server.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.013) to the normalized speed of EclipseLink with H2 database server (3.2) reveals that in that case, OpenJPA with PostgreSQL server is 246 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
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Testfailed3.8failed1.1failed2.5
Element Collection Testfailed4.1failed1.1failed2.6
Inheritance Testfailed3.2failed1.3failed2.3
Indexing Testfailed3.0failed8.0failed5.5
Multithreading Testfailed1.1failed1.0failed1.1
All Testsfailed3.0failed2.5failed2.8

OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Test4.94.53.92.24.43.4
Element Collection Test0.0333.84.62.42.33.1
Inheritance Test4.84.44.93.04.93.7
Indexing Test5.14.26.03.15.63.7
Graph (Binary Tree) Test0.571.40.310.790.441.1
Multithreading Test22.27.87.42.514.85.1
All Tests6.34.34.52.35.43.3

The results above show that in general OpenJPA with PostgreSQL server 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 multithreading with large transaction size. Comparing the normalized speed of EclipseLink with H2 database server (2.5) to the normalized speed of OpenJPA with PostgreSQL database server (7.4) reveals that in that case, OpenJPA with PostgreSQL server is 3.0 times faster than EclipseLink with H2 server.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.033) to the normalized speed of EclipseLink with H2 database server (3.8) reveals that in that case, OpenJPA with PostgreSQL server is 115 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
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Test4.66.45.33.15.04.8
Element Collection Test0.0323.02.81.31.42.2
Inheritance Test4.35.64.62.84.44.2
Indexing Test8.010.37.13.87.57.0
Graph (Binary Tree) Test0.531.50.551.30.541.4
Multithreading Test17.47.09.14.913.36.0
All Tests5.85.64.92.95.44.3

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

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 PostgreSQL database server (17.4) reveals that in that case, OpenJPA with PostgreSQL server is 2.5 times faster than EclipseLink with H2 server.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.032) to the normalized speed of EclipseLink with H2 database server (3.0) reveals that in that case, OpenJPA with PostgreSQL server is 93.8 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
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
OpenJPA
PostgreSQL server
EclipseLink
H2 server
Basic Person Test5.15.27.53.46.34.3
Element Collection Test0.723.64.62.12.62.9
Inheritance Test4.74.97.63.96.24.4
Indexing Test6.36.39.75.78.06.0
Graph (Binary Tree) Test0.592.10.501.90.552.0
Multithreading Test18.77.712.25.715.56.7
All Tests6.05.17.03.86.54.5

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with H2 database server (7.7) to the normalized speed of OpenJPA with PostgreSQL database server (18.7) reveals that in that case, OpenJPA with PostgreSQL server is 2.4 times faster than EclipseLink with H2 server.

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

Other Head to Head DBMS/JPA Comparisons