Compare with

Comparison of Hibernate with H2 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
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test18.10.0749.00.9013.50.49
Element Collection Test13.00.0616.80.659.90.36
Inheritance Test21.00.0839.40.8215.20.45
Indexing Test29.90.1118.41.624.10.87
Graph (Binary Tree) Test17.20.2420.10.9118.70.57
Multithreading Test36.90.1011.52.124.21.1
All Tests22.60.1112.51.217.60.64

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
 Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test16.6failed13.3failed15.0failed
Element Collection Test4.30.00074.0failed4.10.0007
Inheritance Test10.4failed17.5failed13.9failed
Indexing Test10.8failed15.2failed13.0failed
Graph (Binary Tree) Test2.5failed4.0failed3.3failed
Multithreading Test16.2failed15.7failed15.9failed
All Tests10.10.000711.6failed10.90.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 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test4.51.21.2failed2.81.2
Element Collection Test4.40.291.4failed2.90.29
Inheritance Test3.10.691.5failed2.30.69
Indexing Test6.60.000810.5failed8.60.0008
Multithreading Test1.2failed0.59failed0.89failed
All Tests4.00.553.0failed3.50.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 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test12.1failed6.5failed9.3failed
Element Collection Test7.40.00165.3failed6.30.0016
Inheritance Test10.8failed8.5failed9.6failed
Indexing Test10.0failed7.5failed8.8failed
Graph (Binary Tree) Test4.4failed2.3failed3.4failed
Multithreading Test16.2failed4.0failed10.1failed
All Tests10.10.00165.7failed7.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
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test19.7failed11.4failed15.5failed
Element Collection Test6.90.00064.5failed5.70.0006
Inheritance Test15.6failed12.9failed14.2failed
Indexing Test23.2failed12.4failed17.8failed
Graph (Binary Tree) Test4.0failed4.2failed4.1failed
Multithreading Test27.4failed22.7failed25.0failed
All Tests16.10.000611.4failed13.70.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
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test27.079.427.079.427.079.4
Element Collection Test30.674.530.674.530.674.5
Inheritance Test27.075.027.075.027.075.0
Indexing Test31.692.932.194.531.993.7
Graph (Binary Tree) Test28.560.621.448.425.054.5
Multithreading Test33.91009.210021.5100
All Tests29.880.424.678.627.279.5

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
 Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Hibernate
H2 embedded
EclipseLink
SQLite embedded
Basic Person Test14.20.668.30.9011.20.74
Element Collection Test7.20.0704.40.655.80.17
Inheritance Test12.20.389.90.8211.00.53
Indexing Test16.10.05812.81.614.50.58
Graph (Binary Tree) Test7.00.247.70.917.30.57
Multithreading Test19.60.1010.92.115.21.1
All Tests12.90.229.01.211.00.52

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