Compare with

Comparison of Hibernate with H2 server 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
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test4.60.0743.00.903.80.49
Element Collection Test3.70.0611.10.652.40.36
Inheritance Test6.70.0833.10.824.90.45
Indexing Test8.20.114.21.66.20.87
Graph (Binary Tree) Test3.40.243.90.913.70.57
Multithreading Test6.80.105.02.15.91.1
All Tests5.60.113.41.24.50.64

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
 Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test3.1failed6.0failed4.6failed
Element Collection Test1.00.00071.1failed1.00.0007
Inheritance Test2.9failed7.6failed5.2failed
Indexing Test2.6failed7.0failed4.8failed
Graph (Binary Tree) Test0.42failed1.1failed0.78failed
Multithreading Test6.5failed10.5failed8.5failed
All Tests2.80.00075.6failed4.20.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
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test3.71.21.0failed2.31.2
Element Collection Test3.70.290.63failed2.20.29
Inheritance Test3.20.691.4failed2.30.69
Indexing Test1.70.00085.8failed3.80.0008
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.70.551.9failed2.30.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
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test2.9failed1.8failed2.4failed
Element Collection Test2.60.00161.1failed1.90.0016
Inheritance Test3.2failed2.5failed2.9failed
Indexing Test2.9failed2.7failed2.8failed
Graph (Binary Tree) Test1.2failed0.43failed0.79failed
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.10.00161.8failed2.50.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
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test3.8failed2.4failed3.1failed
Element Collection Test1.90.00061.1failed1.50.0006
Inheritance Test3.7failed2.5failed3.1failed
Indexing Test7.6failed3.1failed5.3failed
Graph (Binary Tree) Test0.99failed0.91failed0.95failed
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.00.00062.9failed3.50.0006

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
 Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Hibernate
H2 server
EclipseLink
SQLite embedded
Basic Person Test3.60.662.80.903.20.74
Element Collection Test2.60.0701.00.651.80.17
Inheritance Test4.00.383.40.823.70.53
Indexing Test4.60.0584.51.64.60.58
Graph (Binary Tree) Test1.50.241.60.911.60.57
Multithreading Test5.20.105.22.15.21.1
All Tests3.70.223.21.23.40.52

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