Compare with

Comparison of EclipseLink with SQLite embedded vs Hibernate with HSQLDB 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
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Test0.07432.60.9013.10.4922.9
Element Collection Test0.06115.10.658.20.3611.7
Inheritance Test0.08325.50.8213.60.4519.5
Indexing Test0.1129.61.618.80.8724.2
Graph (Binary Tree) Test0.2413.80.9115.60.5714.7
Multithreading Test0.1037.42.113.01.125.2
All Tests0.1125.61.213.70.6419.7

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
 EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Testfailed24.8failed16.4failed20.6
Element Collection Test0.000711.3failed10.80.000711.0
Inheritance Testfailed21.7failed21.0failed21.3
Indexing Testfailed11.9failed21.5failed16.7
Graph (Binary Tree) Testfailed3.6failed4.7failed4.1
Multithreading Testfailed19.8failed21.5failed20.6
All Tests0.000715.5failed16.00.000715.7

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
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Test1.23.6failed0.881.22.2
Element Collection Test0.293.4failed1.70.292.6
Inheritance Test0.692.9failed1.00.691.9
Indexing Test0.00089.9failed21.70.000815.8
Multithreading Testfailed1.1failed0.58failed0.82
All Tests0.554.2failed5.20.554.7

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
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Testfailed14.2failed5.0failed9.6
Element Collection Test0.001610.1failed5.60.00167.8
Inheritance Testfailed13.4failed7.5failed10.5
Indexing Testfailed10.7failed6.1failed8.4
Graph (Binary Tree) Testfailed3.7failed2.5failed3.1
Multithreading Testfailed23.9failed3.8failed13.9
All Tests0.001612.7failed5.10.00168.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
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Testfailed26.1failed17.5failed21.8
Element Collection Test0.00069.1failed5.20.00067.1
Inheritance Testfailed21.4failed17.7failed19.6
Indexing Testfailed33.0failed16.3failed24.7
Graph (Binary Tree) Testfailed5.4failed8.2failed6.8
Multithreading Testfailed38.5failed28.6failed33.5
All Tests0.000622.3failed15.60.000618.9

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
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Test79.441.479.441.479.441.4
Element Collection Test74.546.974.546.974.546.9
Inheritance Test75.041.475.041.475.041.4
Indexing Test92.948.494.549.293.748.8
Graph (Binary Tree) Test60.628.548.421.454.525.0
Multithreading Test10051.910010.310031.1
All Tests80.443.178.635.179.539.1

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
 EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
EclipseLink
SQLite embedded
Hibernate
HSQLDB embedded
Basic Person Test0.6620.20.9010.60.7415.4
Element Collection Test0.0709.80.656.30.178.0
Inheritance Test0.3817.00.8212.20.5314.6
Indexing Test0.05819.01.616.90.5818.0
Graph (Binary Tree) Test0.246.60.917.80.577.2
Multithreading Test0.1024.12.113.51.118.8
All Tests0.2216.51.211.30.5213.9

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