Compare with

Comparison of Hibernate with HSQLDB 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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test32.60.07413.10.9022.90.49
Element Collection Test15.10.0618.20.6511.70.36
Inheritance Test25.50.08313.60.8219.50.45
Indexing Test29.60.1118.81.624.20.87
Graph (Binary Tree) Test13.80.2415.60.9114.70.57
Multithreading Test37.40.1013.02.125.21.1
All Tests25.60.1113.71.219.70.64

The results above show that in general Hibernate with HSQLDB 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 HSQLDB embedded database (19.7) reveals that in these tests, Hibernate with HSQLDB embedded is 30.8 times faster than EclipseLink with SQLite embedded.

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of EclipseLink with SQLite embedded database (0.074) to the normalized speed of Hibernate with HSQLDB embedded database (32.6) reveals that in that case, Hibernate with HSQLDB embedded is 441 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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test24.8failed16.4failed20.6failed
Element Collection Test11.30.000710.8failed11.00.0007
Inheritance Test21.7failed21.0failed21.3failed
Indexing Test11.9failed21.5failed16.7failed
Graph (Binary Tree) Test3.6failed4.7failed4.1failed
Multithreading Test19.8failed21.5failed20.6failed
All Tests15.50.000716.0failed15.70.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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test3.61.20.88failed2.21.2
Element Collection Test3.40.291.7failed2.60.29
Inheritance Test2.90.691.0failed1.90.69
Indexing Test9.90.000821.7failed15.80.0008
Multithreading Test1.1failed0.58failed0.82failed
All Tests4.20.555.2failed4.70.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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test14.2failed5.0failed9.6failed
Element Collection Test10.10.00165.6failed7.80.0016
Inheritance Test13.4failed7.5failed10.5failed
Indexing Test10.7failed6.1failed8.4failed
Graph (Binary Tree) Test3.7failed2.5failed3.1failed
Multithreading Test23.9failed3.8failed13.9failed
All Tests12.70.00165.1failed8.90.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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test26.1failed17.5failed21.8failed
Element Collection Test9.10.00065.2failed7.10.0006
Inheritance Test21.4failed17.7failed19.6failed
Indexing Test33.0failed16.3failed24.7failed
Graph (Binary Tree) Test5.4failed8.2failed6.8failed
Multithreading Test38.5failed28.6failed33.5failed
All Tests22.30.000615.6failed18.90.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
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test41.479.441.479.441.479.4
Element Collection Test46.974.546.974.546.974.5
Inheritance Test41.475.041.475.041.475.0
Indexing Test48.492.949.294.548.893.7
Graph (Binary Tree) Test28.560.621.448.425.054.5
Multithreading Test51.910010.310031.1100
All Tests43.180.435.178.639.179.5

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Basic Person Test20.20.6610.60.9015.40.74
Element Collection Test9.80.0706.30.658.00.17
Inheritance Test17.00.3812.20.8214.60.53
Indexing Test19.00.05816.91.618.00.58
Graph (Binary Tree) Test6.60.247.80.917.20.57
Multithreading Test24.10.1013.52.118.81.1
All Tests16.50.2211.31.213.90.52

The results above show that in general Hibernate with HSQLDB 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 HSQLDB embedded database (13.9) reveals that in these tests, Hibernate with HSQLDB embedded is 26.7 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 HSQLDB embedded database (19.0) reveals that in that case, Hibernate with HSQLDB embedded is 328 times faster than EclipseLink with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons