Compare with

Comparison of OpenJPA with PostgreSQL server vs EclipseLink with H2 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
 OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Test5.225.14.88.95.017.0
Element Collection Test2.820.42.28.02.514.2
Inheritance Test4.628.73.28.73.918.7
Indexing Test7.437.66.914.07.125.8
Graph (Binary Tree) Test0.9817.70.8114.70.8916.2
Multithreading Test23.430.39.111.416.220.8
All Tests7.426.64.510.95.918.8

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.81) to the normalized speed of EclipseLink with H2 embedded database (14.7) reveals that in that case, EclipseLink with H2 embedded is 18.1 times faster than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Test5.830.416.129.110.929.7
Element Collection Test0.01319.68.727.64.423.6
Inheritance Test5.233.817.639.811.436.8
Indexing Test4.822.218.741.311.831.8
Graph (Binary Tree) Test0.2716.00.3520.00.3118.0
Multithreading Test11.933.723.329.017.631.4
All Tests4.725.914.131.19.428.5

The results above show that in general EclipseLink with H2 embedded is much more efficient than OpenJPA with PostgreSQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of OpenJPA with PostgreSQL database server (9.4) to the normalized speed of EclipseLink with H2 embedded database (28.5) reveals that in these tests, EclipseLink with H2 embedded is 3.0 times faster than OpenJPA with PostgreSQL server.

A huge performance gap has been detected 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 embedded database (19.6) reveals that in that case, EclipseLink with H2 embedded is 1,508 times faster than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Testfailed4.4failed1.4failed2.9
Element Collection Testfailed4.1failed2.4failed3.2
Inheritance Testfailed3.4failed2.0failed2.7
Indexing Testfailed13.0failed22.8failed17.9
Multithreading Testfailed1.0failed0.67failed0.85
All Testsfailed5.2failed5.9failed5.5

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 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Test4.916.63.97.64.412.1
Element Collection Test0.03315.34.610.52.312.9
Inheritance Test4.815.74.99.84.912.7
Indexing Test5.112.16.09.95.611.0
Graph (Binary Tree) Test0.5713.70.317.00.4410.3
Multithreading Test22.220.97.44.214.812.6
All Tests6.315.74.58.25.412.0

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

A huge performance gap has been detected 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 embedded database (15.3) reveals that in that case, EclipseLink with H2 embedded is 464 times faster than OpenJPA with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Test4.635.15.319.65.027.4
Element Collection Test0.03219.32.88.51.413.9
Inheritance Test4.336.04.614.04.425.0
Indexing Test8.042.57.119.27.530.9
Graph (Binary Tree) Test0.5312.20.5514.40.5413.3
Multithreading Test17.454.49.125.813.340.1
All Tests5.833.34.916.95.425.1

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

A huge performance gap has been detected 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 embedded database (19.3) reveals that in that case, EclipseLink with H2 embedded is 603 times faster than OpenJPA with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
Basic Person Test5.122.37.513.36.317.8
Element Collection Test0.7215.74.611.42.613.6
Inheritance Test4.723.57.614.96.219.2
Indexing Test6.325.59.721.58.023.5
Graph (Binary Tree) Test0.5914.90.5014.00.5514.5
Multithreading Test18.728.112.214.215.521.1
All Tests6.021.97.014.96.518.4

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

A huge performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.50) to the normalized speed of EclipseLink with H2 embedded database (14.0) reveals that in that case, EclipseLink with H2 embedded is 28.0 times faster than OpenJPA with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons