Compare with

Comparison of Hibernate with H2 embedded vs ObjectDB 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
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test18.11009.010013.5100
Element Collection Test13.01006.81009.9100
Inheritance Test21.01009.410015.2100
Indexing Test29.910018.410024.1100
Graph (Binary Tree) Test17.288.420.110018.794.2
Multithreading Test36.910011.510024.2100
All Tests22.698.112.510017.699.0

The results above show that in general ObjectDB embedded is much more efficient than Hibernate with H2 embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with H2 embedded database (17.6) to the normalized speed of ObjectDB embedded database (99.0) reveals that in these tests, ObjectDB embedded is 5.6 times faster than Hibernate with H2 embedded.

A huge performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with H2 embedded database (6.8) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 14.7 times faster than Hibernate with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test16.610013.310015.0100
Element Collection Test4.31004.01004.1100
Inheritance Test10.410017.510013.9100
Indexing Test10.810015.210013.0100
Graph (Binary Tree) Test2.51004.01003.3100
Multithreading Test16.210015.710015.9100
All Tests10.110011.610010.9100

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

A huge performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (2.5) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 40.0 times faster than Hibernate with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test4.51001.21002.8100
Element Collection Test4.41001.41002.9100
Inheritance Test3.11001.51002.3100
Indexing Test6.610010.51008.6100
Multithreading Test1.21000.591000.89100
All Tests4.01003.01003.5100

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

A huge performance gap has been detected when using multithreading with large retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (0.59) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 169 times faster than Hibernate with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test12.11006.51009.3100
Element Collection Test7.41005.31006.3100
Inheritance Test10.81008.51009.6100
Indexing Test10.01007.51008.8100
Graph (Binary Tree) Test4.41002.31003.4100
Multithreading Test16.21004.010010.1100
All Tests10.11005.71007.9100

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with H2 embedded database (2.3) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 43.5 times faster than Hibernate with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test19.710011.410015.5100
Element Collection Test6.91004.51005.7100
Inheritance Test15.610012.910014.2100
Indexing Test23.210012.410017.8100
Graph (Binary Tree) Test4.01004.21004.1100
Multithreading Test27.410022.710025.0100
All Tests16.110011.410013.7100

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

A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with H2 embedded database (4.0) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 25.0 times faster than Hibernate with H2 embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test27.010027.010027.0100
Element Collection Test30.610030.610030.6100
Inheritance Test27.010027.010027.0100
Indexing Test31.610032.110031.9100
Graph (Binary Tree) Test28.510021.410025.0100
Multithreading Test33.991.19.222.021.556.6
All Tests29.898.524.687.027.292.8

The results above show that in general ObjectDB embedded is much 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 ObjectDB embedded database (92.8) reveals that in these tests, ObjectDB embedded is 3.4 times more efficient than Hibernate with H2 embedded.

A large gap has been detected when using graphs of objects with large transaction size. Comparing the normalized score of Hibernate with H2 embedded database (21.4) to the normalized score of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 4.7 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
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embeddedHibernate
H2 embedded
ObjectDB embedded
Basic Person Test14.21008.310011.2100
Element Collection Test7.21004.41005.8100
Inheritance Test12.21009.910011.0100
Indexing Test16.110012.810014.5100
Graph (Binary Tree) Test7.097.17.71007.398.5
Multithreading Test19.610010.910015.2100
All Tests12.999.69.010011.099.8

The results above show that in general ObjectDB embedded is much more efficient than Hibernate with H2 embedded in performing JPA database operations. Comparing the normalized speed of Hibernate with H2 embedded database (11.0) to the normalized speed of ObjectDB embedded database (99.8) reveals that in these tests, ObjectDB embedded is 9.1 times faster than Hibernate with H2 embedded.

A huge performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (4.4) to the normalized speed of ObjectDB embedded database (100) reveals that in that case, ObjectDB embedded is 22.7 times faster than Hibernate with H2 embedded.

Other Head to Head DBMS/JPA Comparisons