Compare with

Comparison of EclipseLink with SQLite embedded vs OpenJPA 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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Test0.07417.10.905.80.4911.5
Element Collection Test0.06110.90.654.90.367.9
Inheritance Test0.08314.30.825.90.4510.1
Indexing Test0.1124.41.613.70.8719.1
Graph (Binary Tree) Test0.246.80.916.70.576.7
Multithreading Test0.1034.22.110.21.122.2
All Tests0.1117.91.27.90.6412.9

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Testfailed14.6failed27.2failed20.9
Element Collection Test0.00070.0046failed4.30.00072.1
Inheritance Testfailed0.011failed7.4failed3.7
Indexing Testfailed17.0failed35.0failed26.0
Graph (Binary Tree) Testfailed1.0failed1.4failed1.2
Multithreading Testfailed18.7failed27.6failed23.1
All Tests0.00078.6failed17.10.000712.8

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Test1.25.0failed1.11.23.1
Element Collection Test0.291.7failed1.30.291.5
Inheritance Test0.692.2failed1.20.691.7
Indexing Test0.000813.8failed23.20.000818.5
Multithreading Testfailed1.4failed0.60failed0.99
All Tests0.554.8failed5.50.555.1

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Testfailed10.0failed6.0failed8.0
Element Collection Test0.00160.011failed3.80.00161.9
Inheritance Testfailed0.046failed5.0failed2.5
Indexing Testfailed8.9failed7.0failed8.0
Graph (Binary Tree) Testfailed2.4failed1.3failed1.9
Multithreading Testfailed16.6failed4.3failed10.4
All Tests0.00166.3failed4.60.00165.4

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Testfailed18.3failed11.1failed14.7
Element Collection Test0.00060.012failed2.90.00061.4
Inheritance Testfailed0.030failed6.6failed3.3
Indexing Testfailed23.2failed9.7failed16.4
Graph (Binary Tree) Testfailed1.8failed2.4failed2.1
Multithreading Testfailed31.2failed17.3failed24.2
All Tests0.000612.4failed8.30.000610.4

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Test79.427.079.427.079.427.0
Element Collection Test74.530.674.530.674.530.6
Inheritance Test75.027.075.027.075.027.0
Indexing Test92.931.694.532.193.731.9
Graph (Binary Tree) Test60.628.548.421.454.524.9
Multithreading Test10033.91009.210021.5
All Tests80.429.878.624.579.527.2

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
 EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
EclipseLink
SQLite embedded
OpenJPA
H2 embedded
Basic Person Test0.6613.00.9010.20.7411.6
Element Collection Test0.0702.50.653.40.173.0
Inheritance Test0.383.30.825.20.534.3
Indexing Test0.05817.51.617.70.5817.6
Graph (Binary Tree) Test0.243.00.913.00.573.0
Multithreading Test0.1020.42.112.01.116.2
All Tests0.2210.21.28.80.529.5

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