Compare with

Comparison of EclipseLink with Derby 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
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test5.55.23.74.84.65.0
Element Collection Test3.02.81.72.22.42.5
Inheritance Test5.34.63.53.24.43.9
Indexing Test6.97.44.66.95.87.1
Graph (Binary Tree) Test2.00.981.90.811.90.89
Multithreading Test9.323.44.19.16.716.2
All Tests5.37.43.24.54.35.9

The results above show that in general OpenJPA with PostgreSQL server is more efficient than EclipseLink with Derby embedded 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 Derby embedded database (9.3) to the normalized speed of OpenJPA with PostgreSQL database server (23.4) reveals that in that case, OpenJPA with PostgreSQL server is 2.5 times faster than EclipseLink with Derby embedded.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, 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 Derby embedded database (1.9) reveals that in that case, OpenJPA with PostgreSQL server is 2.3 times slower than EclipseLink with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test16.45.858.716.137.510.9
Element Collection Test7.50.01313.38.710.44.4
Inheritance Test17.15.258.917.638.011.4
Indexing Test14.24.867.418.740.811.8
Graph (Binary Tree) Test2.80.275.70.354.20.31
Multithreading Test28.011.948.723.338.417.6
All Tests14.34.742.114.128.29.4

The results above show that in general EclipseLink with Derby 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 Derby embedded database (28.2) reveals that in these tests, EclipseLink with Derby 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 Derby embedded database (7.5) reveals that in that case, EclipseLink with Derby embedded is 577 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
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test53.4failed13.8failed33.6failed
Element Collection Test37.9failed4.4failed21.2failed
Inheritance Test37.4failed15.0failed26.2failed
Indexing Test7.6failed49.3failed28.4failed
Multithreading Test41.2failed6.1failed23.6failed
All Tests35.5failed17.7failed26.6failed

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
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test6.44.96.73.96.54.4
Element Collection Test5.40.0336.24.65.82.3
Inheritance Test6.54.89.24.97.84.9
Indexing Test7.35.111.16.09.25.6
Graph (Binary Tree) Test2.80.571.70.312.20.44
Multithreading Test21.322.25.07.413.114.8
All Tests8.36.36.64.57.55.4

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

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 Derby embedded database (5.4) reveals that in that case, EclipseLink with Derby embedded is 164 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
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test4.64.64.75.34.65.0
Element Collection Test2.50.0321.42.81.91.4
Inheritance Test3.94.34.54.64.24.4
Indexing Test6.28.03.87.15.07.5
Graph (Binary Tree) Test1.10.531.00.551.10.54
Multithreading Test6.217.45.89.16.013.3
All Tests4.15.83.54.93.85.4

The results above show that in general OpenJPA with PostgreSQL server is more efficient than EclipseLink with Derby embedded 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 Derby embedded database (6.2) to the normalized speed of OpenJPA with PostgreSQL database server (17.4) reveals that in that case, OpenJPA with PostgreSQL server is 2.8 times faster than EclipseLink with Derby embedded.

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 Derby embedded database (2.5) reveals that in that case, OpenJPA with PostgreSQL server is 78.1 times slower than EclipseLink with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
EclipseLink
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test17.35.117.57.517.46.3
Element Collection Test11.30.725.44.68.32.6
Inheritance Test14.04.718.27.616.16.2
Indexing Test8.46.327.29.717.88.0
Graph (Binary Tree) Test2.20.592.60.502.40.55
Multithreading Test21.218.713.912.217.615.5
All Tests12.76.014.57.013.66.5

The results above show that in general EclipseLink with Derby 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 Derby embedded database (13.6) reveals that in these tests, EclipseLink with Derby embedded is 2.1 times faster than OpenJPA with PostgreSQL server.

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

Other Head to Head DBMS/JPA Comparisons