Compare with

Comparison of EclipseLink with H2 embedded vs OpenJPA 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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test25.15.28.94.817.05.0
Element Collection Test20.42.88.02.214.22.5
Inheritance Test28.74.68.73.218.73.9
Indexing Test37.67.414.06.925.87.1
Graph (Binary Tree) Test17.70.9814.70.8116.20.89
Multithreading Test30.323.411.49.120.816.2
All Tests26.67.410.94.518.85.9

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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test30.45.829.116.129.710.9
Element Collection Test19.60.01327.68.723.64.4
Inheritance Test33.85.239.817.636.811.4
Indexing Test22.24.841.318.731.811.8
Graph (Binary Tree) Test16.00.2720.00.3518.00.31
Multithreading Test33.711.929.023.331.417.6
All Tests25.94.731.114.128.59.4

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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test4.4failed1.4failed2.9failed
Element Collection Test4.1failed2.4failed3.2failed
Inheritance Test3.4failed2.0failed2.7failed
Indexing Test13.0failed22.8failed17.9failed
Multithreading Test1.0failed0.67failed0.85failed
All Tests5.2failed5.9failed5.5failed

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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test16.64.97.63.912.14.4
Element Collection Test15.30.03310.54.612.92.3
Inheritance Test15.74.89.84.912.74.9
Indexing Test12.15.19.96.011.05.6
Graph (Binary Tree) Test13.70.577.00.3110.30.44
Multithreading Test20.922.24.27.412.614.8
All Tests15.76.38.24.512.05.4

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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test35.14.619.65.327.45.0
Element Collection Test19.30.0328.52.813.91.4
Inheritance Test36.04.314.04.625.04.4
Indexing Test42.58.019.27.130.97.5
Graph (Binary Tree) Test12.20.5314.40.5513.30.54
Multithreading Test54.417.425.89.140.113.3
All Tests33.35.816.94.925.15.4

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
 EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
EclipseLink
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test22.35.113.37.517.86.3
Element Collection Test15.70.7211.44.613.62.6
Inheritance Test23.54.714.97.619.26.2
Indexing Test25.56.321.59.723.58.0
Graph (Binary Tree) Test14.90.5914.00.5014.50.55
Multithreading Test28.118.714.212.221.115.5
All Tests21.96.014.97.018.46.5

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