相关文章推荐
坏坏的猴子  ·  sqlite ...·  2 月前    · 
刚失恋的蚂蚁  ·  sql - Fastest Way ...·  2 月前    · 
安静的山寨机  ·  background image url ...·  2 年前    · 
有情有义的铁板烧  ·  android - ...·  2 年前    · 
Compare with

Comparison of Hibernate with H2 server vs Hibernate 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 &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test4.60.0833.01.03.80.55Element Collection Test3.70.0671.10.692.40.38Inheritance Test6.70.0803.10.994.90.54Indexing Test8.20.0984.21.06.20.55Graph (Binary Tree) Test3.40.273.90.963.70.61Multithreading Test6.8failed5.0failed5.9failedAll Tests5.60.123.40.934.50.53

Hibernate with SQLite embedded has failed in 2 tests ( see exceptions ).

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of Hibernate with H2 database server (4.5) reveals that in these tests, Hibernate with H2 server is 8.5 times faster than Hibernate 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 Hibernate with SQLite embedded database (0.080) to the normalized speed of Hibernate with H2 database server (6.7) reveals that in that case, Hibernate with H2 server is 83.8 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test3.11.86.01.34.61.5Element Collection Test1.00.00081.1failed1.00.0008Inheritance Test2.92.47.61.45.21.9Indexing Test2.61.97.02.34.82.1Graph (Binary Tree) Test0.420.561.10.880.780.72Multithreading Test6.5failed10.5failed8.5failedAll Tests2.81.35.61.54.21.4

Hibernate with SQLite embedded has failed in 3 tests ( see exceptions ).

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (1.4) to the normalized speed of Hibernate with H2 database server (4.2) reveals that in these tests, Hibernate with H2 server is 3.0 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0008) to the normalized speed of Hibernate with H2 database server (1.0) reveals that in that case, Hibernate with H2 server is 1,250 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test3.71.11.00.222.30.65Element Collection Test3.70.390.63failed2.20.39Inheritance Test3.20.531.40.282.30.40Indexing Test1.70.00115.80.433.80.21Multithreading Test1.1failed0.88failed1.0failedAll Tests2.70.501.90.312.30.42

Hibernate with SQLite embedded has failed in 3 tests ( see exceptions ).

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of Hibernate with H2 database server (2.3) reveals that in these tests, Hibernate with H2 server is 5.5 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0011) to the normalized speed of Hibernate with H2 database server (1.7) reveals that in that case, Hibernate with H2 server is 1,545 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test2.90.0761.80.652.40.37Element Collection Test2.60.00221.1failed1.90.0022Inheritance Test3.20.0792.50.972.90.53Indexing Test2.90.0572.70.542.80.30Graph (Binary Tree) Test1.20.260.430.420.790.34Multithreading Test5.6failed2.4failed4.0failedAll Tests3.10.0941.80.652.50.34

Hibernate with SQLite embedded has failed in 3 tests ( see exceptions ).

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.34) to the normalized speed of Hibernate with H2 database server (2.5) reveals that in these tests, Hibernate with H2 server is 7.4 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0022) to the normalized speed of Hibernate with H2 database server (2.6) reveals that in that case, Hibernate with H2 server is 1,182 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test3.80.0612.40.913.10.49Element Collection Test1.90.00071.1failed1.50.0007Inheritance Test3.70.0582.50.903.10.48Indexing Test7.60.0793.10.545.30.31Graph (Binary Tree) Test0.990.240.910.800.950.52Multithreading Test6.1failed7.3failed6.7failedAll Tests4.00.0882.90.793.50.40

Hibernate with SQLite embedded has failed in 3 tests ( see exceptions ).

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.40) to the normalized speed of Hibernate with H2 database server (3.5) reveals that in these tests, Hibernate with H2 server is 8.8 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0007) to the normalized speed of Hibernate with H2 database server (1.9) reveals that in that case, Hibernate with H2 server is 2,714 times faster than Hibernate with SQLite embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score &nbspHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embeddedHibernate
H2 serverHibernate
SQLite embedded Basic Person Test3.60.632.80.813.20.72Element Collection Test2.60.0921.00.691.80.19Inheritance Test4.00.633.40.913.70.77Indexing Test4.60.424.50.964.60.69Graph (Binary Tree) Test1.50.331.60.771.60.55Multithreading Test5.2failed5.2failed5.2failedAll Tests3.70.423.20.863.40.62

The results above show that in general Hibernate with H2 server is much more efficient than Hibernate with SQLite embedded in performing JPA database operations. Comparing the normalized speed of Hibernate with SQLite embedded database (0.62) to the normalized speed of Hibernate with H2 database server (3.4) reveals that in these tests, Hibernate with H2 server is 5.5 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.092) to the normalized speed of Hibernate with H2 database server (2.6) reveals that in that case, Hibernate with H2 server is 28.3 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons