Compare with

Comparison of EclipseLink with SQLite embedded vs Hibernate 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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.07418.10.909.00.4913.5
Element Collection Test0.06113.00.656.80.369.9
Inheritance Test0.08321.00.829.40.4515.2
Indexing Test0.1129.91.618.40.8724.1
Graph (Binary Tree) Test0.2417.20.9120.10.5718.7
Multithreading Test0.1036.92.111.51.124.2
All Tests0.1122.61.212.50.6417.6

The results above show that in general Hibernate 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 Hibernate with H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 27.5 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 Hibernate with H2 embedded database (36.9) reveals that in that case, Hibernate with H2 embedded is 369 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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Testfailed16.6failed13.3failed15.0
Element Collection Test0.00074.3failed4.00.00074.1
Inheritance Testfailed10.4failed17.5failed13.9
Indexing Testfailed10.8failed15.2failed13.0
Graph (Binary Tree) Testfailed2.5failed4.0failed3.3
Multithreading Testfailed16.2failed15.7failed15.9
All Tests0.000710.1failed11.60.000710.9

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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Test1.24.5failed1.21.22.8
Element Collection Test0.294.4failed1.40.292.9
Inheritance Test0.693.1failed1.50.692.3
Indexing Test0.00086.6failed10.50.00088.6
Multithreading Testfailed1.2failed0.59failed0.89
All Tests0.554.0failed3.00.553.5

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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Testfailed12.1failed6.5failed9.3
Element Collection Test0.00167.4failed5.30.00166.3
Inheritance Testfailed10.8failed8.5failed9.6
Indexing Testfailed10.0failed7.5failed8.8
Graph (Binary Tree) Testfailed4.4failed2.3failed3.4
Multithreading Testfailed16.2failed4.0failed10.1
All Tests0.001610.1failed5.70.00167.9

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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Testfailed19.7failed11.4failed15.5
Element Collection Test0.00066.9failed4.50.00065.7
Inheritance Testfailed15.6failed12.9failed14.2
Indexing Testfailed23.2failed12.4failed17.8
Graph (Binary Tree) Testfailed4.0failed4.2failed4.1
Multithreading Testfailed27.4failed22.7failed25.0
All Tests0.000616.1failed11.40.000613.7

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
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
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.525.0
Multithreading Test10033.91009.210021.5
All Tests80.429.878.624.679.527.2

The results above show that in general EclipseLink with SQLite embedded is more efficient than Hibernate with H2 embedded in using disk space. Comparing the normalized score of Hibernate 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 Hibernate with H2 embedded.

A huge gap has been detected when using multithreading with large transaction size. Comparing the normalized score of Hibernate 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 Hibernate with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.6614.20.908.30.7411.2
Element Collection Test0.0707.20.654.40.175.8
Inheritance Test0.3812.20.829.90.5311.0
Indexing Test0.05816.11.612.80.5814.5
Graph (Binary Tree) Test0.247.00.917.70.577.3
Multithreading Test0.1019.62.110.91.115.2
All Tests0.2212.91.29.00.5211.0

The results above show that in general Hibernate 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 Hibernate with H2 embedded database (11.0) reveals that in these tests, Hibernate with H2 embedded is 21.2 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 Hibernate with H2 embedded database (16.1) reveals that in that case, Hibernate with H2 embedded is 278 times faster than EclipseLink with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons