Compare with

Comparison of OpenJPA with PostgreSQL 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
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.20.0834.81.05.00.55
Element Collection Test2.80.0672.20.692.50.38
Inheritance Test4.60.0803.20.993.90.54
Indexing Test7.40.0986.91.07.10.55
Graph (Binary Tree) Test0.980.270.810.960.890.61
Multithreading Test23.4failed9.1failed16.2failed
All Tests7.40.124.50.935.90.53

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
 OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.81.816.11.310.91.5
Element Collection Test0.0130.00088.7failed4.40.0008
Inheritance Test5.22.417.61.411.41.9
Indexing Test4.81.918.72.311.82.1
Graph (Binary Tree) Test0.270.560.350.880.310.72
Multithreading Test11.9failed23.3failed17.6failed
All Tests4.71.314.11.59.41.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
 OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Testfailed1.1failed0.22failed0.65
Element Collection Testfailed0.39failedfailedfailed0.39
Inheritance Testfailed0.53failed0.28failed0.40
Indexing Testfailed0.0011failed0.43failed0.21
Multithreading Testfailedfailedfailedfailedfailedfailed
All Testsfailed0.50failed0.31failed0.42

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test4.90.0763.90.654.40.37
Element Collection Test0.0330.00224.6failed2.30.0022
Inheritance Test4.80.0794.90.974.90.53
Indexing Test5.10.0576.00.545.60.30
Graph (Binary Tree) Test0.570.260.310.420.440.34
Multithreading Test22.2failed7.4failed14.8failed
All Tests6.30.0944.50.655.40.34

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
 OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test4.60.0615.30.915.00.49
Element Collection Test0.0320.00072.8failed1.40.0007
Inheritance Test4.30.0584.60.904.40.48
Indexing Test8.00.0797.10.547.50.31
Graph (Binary Tree) Test0.530.240.550.800.540.52
Multithreading Test17.4failed9.1failed13.3failed
All Tests5.80.0884.90.795.40.40

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
 OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
OpenJPA
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.10.637.50.816.30.72
Element Collection Test0.720.0924.60.692.60.19
Inheritance Test4.70.637.60.916.20.77
Indexing Test6.30.429.70.968.00.69
Graph (Binary Tree) Test0.590.330.500.770.550.55
Multithreading Test18.7failed12.2failed15.5failed
All Tests6.00.427.00.866.50.62

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