Compare with

Comparison of EclipseLink with SQLite embedded vs Hibernate with H2 server

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 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Test0.0744.60.903.00.493.8
Element Collection Test0.0613.70.651.10.362.4
Inheritance Test0.0836.70.823.10.454.9
Indexing Test0.118.21.64.20.876.2
Graph (Binary Tree) Test0.243.40.913.90.573.7
Multithreading Test0.106.82.15.01.15.9
All Tests0.115.61.23.40.644.5

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of EclipseLink with SQLite embedded database (0.083) to the normalized speed of Hibernate with H2 database server (6.7) reveals that in that case, Hibernate with H2 server is 80.7 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 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Testfailed3.1failed6.0failed4.6
Element Collection Test0.00071.0failed1.10.00071.0
Inheritance Testfailed2.9failed7.6failed5.2
Indexing Testfailed2.6failed7.0failed4.8
Graph (Binary Tree) Testfailed0.42failed1.1failed0.78
Multithreading Testfailed6.5failed10.5failed8.5
All Tests0.00072.8failed5.60.00074.2

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 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Test1.23.7failed1.01.22.3
Element Collection Test0.293.7failed0.630.292.2
Inheritance Test0.693.2failed1.40.692.3
Indexing Test0.00081.7failed5.80.00083.8
Multithreading Testfailed1.1failed0.88failed1.0
All Tests0.552.7failed1.90.552.3

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 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Testfailed2.9failed1.8failed2.4
Element Collection Test0.00162.6failed1.10.00161.9
Inheritance Testfailed3.2failed2.5failed2.9
Indexing Testfailed2.9failed2.7failed2.8
Graph (Binary Tree) Testfailed1.2failed0.43failed0.79
Multithreading Testfailed5.6failed2.4failed4.0
All Tests0.00163.1failed1.80.00162.5

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 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Testfailed3.8failed2.4failed3.1
Element Collection Test0.00061.9failed1.10.00061.5
Inheritance Testfailed3.7failed2.5failed3.1
Indexing Testfailed7.6failed3.1failed5.3
Graph (Binary Tree) Testfailed0.99failed0.91failed0.95
Multithreading Testfailed6.1failed7.3failed6.7
All Tests0.00064.0failed2.90.00063.5

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
Basic Person Test0.663.60.902.80.743.2
Element Collection Test0.0702.60.651.00.171.8
Inheritance Test0.384.00.823.40.533.7
Indexing Test0.0584.61.64.50.584.6
Graph (Binary Tree) Test0.241.50.911.60.571.6
Multithreading Test0.105.22.15.21.15.2
All Tests0.223.71.23.20.523.4

The results above show that in general Hibernate with H2 server 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 database server (3.4) reveals that in these tests, Hibernate with H2 server is 6.5 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 database server (4.6) reveals that in that case, Hibernate with H2 server is 79.3 times faster than EclipseLink with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons