Compare with

Comparison of OpenJPA with H2 embedded vs EclipseLink with SQLite 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
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test17.10.0745.80.9011.50.49
Element Collection Test10.90.0614.90.657.90.36
Inheritance Test14.30.0835.90.8210.10.45
Indexing Test24.40.1113.71.619.10.87
Graph (Binary Tree) Test6.80.246.70.916.70.57
Multithreading Test34.20.1010.22.122.21.1
All Tests17.90.117.91.212.90.64

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of EclipseLink with SQLite embedded database (0.10) to the normalized speed of OpenJPA with H2 embedded database (34.2) reveals that in that case, OpenJPA with H2 embedded is 342 times faster than EclipseLink with SQLite embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test14.6failed27.2failed20.9failed
Element Collection Test0.00460.00074.3failed2.10.0007
Inheritance Test0.011failed7.4failed3.7failed
Indexing Test17.0failed35.0failed26.0failed
Graph (Binary Tree) Test1.0failed1.4failed1.2failed
Multithreading Test18.7failed27.6failed23.1failed
All Tests8.60.000717.1failed12.80.0007

EclipseLink with SQLite embedded has failed in 11 tests (see exceptions).

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test5.01.21.1failed3.11.2
Element Collection Test1.70.291.3failed1.50.29
Inheritance Test2.20.691.2failed1.70.69
Indexing Test13.80.000823.2failed18.50.0008
Multithreading Test1.4failed0.60failed0.99failed
All Tests4.80.555.5failed5.10.55

EclipseLink with SQLite embedded has failed in 6 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test10.0failed6.0failed8.0failed
Element Collection Test0.0110.00163.8failed1.90.0016
Inheritance Test0.046failed5.0failed2.5failed
Indexing Test8.9failed7.0failed8.0failed
Graph (Binary Tree) Test2.4failed1.3failed1.9failed
Multithreading Test16.6failed4.3failed10.4failed
All Tests6.30.00164.6failed5.40.0016

EclipseLink with SQLite embedded has failed in 11 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test18.3failed11.1failed14.7failed
Element Collection Test0.0120.00062.9failed1.40.0006
Inheritance Test0.030failed6.6failed3.3failed
Indexing Test23.2failed9.7failed16.4failed
Graph (Binary Tree) Test1.8failed2.4failed2.1failed
Multithreading Test31.2failed17.3failed24.2failed
All Tests12.40.00068.3failed10.40.0006

EclipseLink with SQLite embedded has failed in 11 tests (see exceptions).

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test27.079.427.079.427.079.4
Element Collection Test30.674.530.674.530.674.5
Inheritance Test27.075.027.075.027.075.0
Indexing Test31.692.932.194.531.993.7
Graph (Binary Tree) Test28.560.621.448.424.954.5
Multithreading Test33.91009.210021.5100
All Tests29.880.424.578.627.279.5

The results above show that in general EclipseLink with SQLite embedded is more efficient than OpenJPA with H2 embedded in using disk space. Comparing the normalized score of OpenJPA with H2 embedded database (27.2) to the normalized score of EclipseLink with SQLite embedded database (79.5) reveals that in these tests, EclipseLink with SQLite embedded is 2.9 times more efficient than OpenJPA with H2 embedded.

A huge gap has been detected when using multithreading with large transaction size. Comparing the normalized score of OpenJPA with H2 embedded database (9.2) to the normalized score of EclipseLink with SQLite embedded database (100) reveals that in that case, EclipseLink with SQLite embedded is 10.9 times more efficient than OpenJPA with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test13.00.6610.20.9011.60.74
Element Collection Test2.50.0703.40.653.00.17
Inheritance Test3.30.385.20.824.30.53
Indexing Test17.50.05817.71.617.60.58
Graph (Binary Tree) Test3.00.243.00.913.00.57
Multithreading Test20.40.1012.02.116.21.1
All Tests10.20.228.81.29.50.52

The results above show that in general OpenJPA with H2 embedded is much more efficient than EclipseLink with SQLite embedded in performing JPA database operations. Comparing the normalized speed of EclipseLink with SQLite embedded database (0.52) to the normalized speed of OpenJPA with H2 embedded database (9.5) reveals that in these tests, OpenJPA with H2 embedded is 18.3 times faster than EclipseLink with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with SQLite embedded database (0.058) to the normalized speed of OpenJPA with H2 embedded database (17.5) reveals that in that case, OpenJPA with H2 embedded is 302 times faster than EclipseLink with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons