Compare with

Comparison of Hibernate with SQLite embedded vs OpenJPA with PostgreSQL server

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
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test0.0835.21.04.80.555.0
Element Collection Test0.0672.80.692.20.382.5
Inheritance Test0.0804.60.993.20.543.9
Indexing Test0.0987.41.06.90.557.1
Graph (Binary Tree) Test0.270.980.960.810.610.89
Multithreading Testfailed23.4failed9.1failed16.2
All Tests0.127.40.934.50.535.9

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

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (5.9) reveals that in these tests, OpenJPA with PostgreSQL server is 11.1 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 PostgreSQL database server (7.4) reveals that in that case, OpenJPA with PostgreSQL server is 75.5 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
 Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test1.85.81.316.11.510.9
Element Collection Test0.00080.013failed8.70.00084.4
Inheritance Test2.45.21.417.61.911.4
Indexing Test1.94.82.318.72.111.8
Graph (Binary Tree) Test0.560.270.880.350.720.31
Multithreading Testfailed11.9failed23.3failed17.6
All Tests1.34.71.514.11.49.4

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

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (9.4) reveals that in these tests, OpenJPA with PostgreSQL server is 6.7 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 OpenJPA with PostgreSQL database server (0.013) reveals that in that case, OpenJPA with PostgreSQL server is 16.2 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.35) to the normalized speed of Hibernate with SQLite embedded database (0.88) reveals that in that case, OpenJPA with PostgreSQL server is 2.5 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
 Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test1.1failed0.22failed0.65failed
Element Collection Test0.39failedfailedfailed0.39failed
Inheritance Test0.53failed0.28failed0.40failed
Indexing Test0.0011failed0.43failed0.21failed
Multithreading Testfailedfailedfailedfailedfailedfailed
All Tests0.50failed0.31failed0.42failed

Hibernate with SQLite embedded has failed in 3 tests (see exceptions). OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test0.0764.90.653.90.374.4
Element Collection Test0.00220.033failed4.60.00222.3
Inheritance Test0.0794.80.974.90.534.9
Indexing Test0.0575.10.546.00.305.6
Graph (Binary Tree) Test0.260.570.420.310.340.44
Multithreading Testfailed22.2failed7.4failed14.8
All Tests0.0946.30.654.50.345.4

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

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (5.4) reveals that in these tests, OpenJPA with PostgreSQL server is 15.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 PostgreSQL database server (5.1) reveals that in that case, OpenJPA with PostgreSQL server is 89.5 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
 Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test0.0614.60.915.30.495.0
Element Collection Test0.00070.032failed2.80.00071.4
Inheritance Test0.0584.30.904.60.484.4
Indexing Test0.0798.00.547.10.317.5
Graph (Binary Tree) Test0.240.530.800.550.520.54
Multithreading Testfailed17.4failed9.1failed13.3
All Tests0.0885.80.794.90.405.4

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

The results above show that in general OpenJPA with PostgreSQL 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 PostgreSQL database server (5.4) reveals that in these tests, OpenJPA with PostgreSQL server is 13.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.079) to the normalized speed of OpenJPA with PostgreSQL database server (8.0) reveals that in that case, OpenJPA with PostgreSQL server is 101 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
 Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Basic Person Test0.635.10.817.50.726.3
Element Collection Test0.0920.720.694.60.192.6
Inheritance Test0.634.70.917.60.776.2
Indexing Test0.426.30.969.70.698.0
Graph (Binary Tree) Test0.330.590.770.500.550.55
Multithreading Testfailed18.7failed12.2failed15.5
All Tests0.426.00.867.00.626.5

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

A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with PostgreSQL database server (6.3) reveals that in that case, OpenJPA with PostgreSQL server is 15.0 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons