Compare with

Comparison of OpenJPA with Derby 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
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test3.10.0832.71.02.90.55
Element Collection Test2.00.0671.70.691.80.38
Inheritance Test3.00.0802.30.992.60.54
Indexing Test4.70.0984.11.04.40.55
Graph (Binary Tree) Test0.710.270.640.960.670.61
Multithreading Test6.0failed3.8failed4.9failed
All Tests3.30.122.50.932.90.53

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

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

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.098) to the normalized speed of OpenJPA with Derby database server (4.7) reveals that in that case, OpenJPA with Derby server is 48.0 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
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test0.781.811.61.36.21.5
Element Collection Test0.00240.00081.1failed0.540.0008
Inheritance Test0.0142.45.01.42.51.9
Indexing Test0.621.913.02.36.82.1
Graph (Binary Tree) Test0.0650.560.390.880.230.72
Multithreading Test1.6failed19.0failed10.3failed
All Tests0.511.38.41.54.41.4

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

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

A large performance gap has been detected when using simple basic entities with large retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (1.3) to the normalized speed of OpenJPA with Derby database server (11.6) reveals that in that case, OpenJPA with Derby server is 8.9 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with Derby server is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.014) to the normalized speed of Hibernate with SQLite embedded database (2.4) reveals that in that case, OpenJPA with Derby server is 171 times slower than Hibernate with SQLite embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test29.21.15.50.2217.30.65
Element Collection Test2.20.391.4failed1.80.39
Inheritance Test2.20.531.00.281.60.40
Indexing Test2.20.001111.70.437.00.21
Multithreading Test35.5failed8.3failed21.9failed
All Tests14.30.505.60.319.90.42

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

The results above show that in general OpenJPA with Derby 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 OpenJPA with Derby database server (9.9) reveals that in these tests, OpenJPA with Derby server is 23.6 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 OpenJPA with Derby database server (2.2) reveals that in that case, OpenJPA with Derby server is 2,000 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
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test1.50.0764.00.652.80.37
Element Collection Test0.00810.00221.9failed0.940.0022
Inheritance Test0.0430.0793.80.971.90.53
Indexing Test1.80.0576.80.544.30.30
Graph (Binary Tree) Test0.160.260.270.420.220.34
Multithreading Test6.9failed5.0failed5.9failed
All Tests1.70.0943.60.652.70.34

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

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

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.057) to the normalized speed of OpenJPA with Derby database server (1.8) reveals that in that case, OpenJPA with Derby server is 31.6 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
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test1.40.0613.70.912.50.49
Element Collection Test0.00820.00071.4failed0.710.0007
Inheritance Test0.0350.0582.50.901.30.48
Indexing Test2.30.0793.50.542.90.31
Graph (Binary Tree) Test0.130.240.350.800.240.52
Multithreading Test3.6failed4.0failed3.8failed
All Tests1.30.0882.60.791.90.40

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

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

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.079) to the normalized speed of OpenJPA with Derby database server (2.3) reveals that in that case, OpenJPA with Derby server is 29.1 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with Derby server is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.35) to the normalized speed of Hibernate with SQLite embedded database (0.80) reveals that in that case, OpenJPA with Derby server is 2.3 times slower than Hibernate with SQLite embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
OpenJPA
Derby server
Hibernate
SQLite embedded
Basic Person Test7.20.635.50.816.40.72
Element Collection Test0.840.0921.50.691.20.19
Inheritance Test1.10.632.90.912.00.77
Indexing Test2.30.427.80.965.10.69
Graph (Binary Tree) Test0.270.330.410.770.340.55
Multithreading Test10.7failed8.0failed9.4failed
All Tests3.90.424.50.864.20.62

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

A huge performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.63) to the normalized speed of OpenJPA with Derby database server (7.2) reveals that in that case, OpenJPA with Derby server is 11.4 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons