Comparison of OpenJPA with MySQL server vs Hibernate with MySQL server

From: http://www.jpab.org/OpenJPA/MySQL/server/Hibernate/MySQL/server.html

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test3.93.61.61.62.72.6
Element Collection Test1.61.60.680.721.11.1
Inheritance Test3.63.71.41.62.52.7
Indexing Test5.65.42.42.64.04.0
Graph (Binary Tree) Test0.681.50.571.20.631.4
Multithreading Test7.27.42.72.94.95.2
All Tests3.73.91.51.82.62.8

The results above show that in general Hibernate with MySQL server is slightly more efficient than OpenJPA with MySQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.68) to the normalized speed of Hibernate with MySQL database server (1.5) reveals that in that case, Hibernate with MySQL server is 2.2 times faster than OpenJPA with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test3.23.022.711.012.97.0
Element Collection Test0.00380.342.91.21.40.79
Inheritance Test0.0171.36.914.53.47.9
Indexing Test2.42.523.412.812.97.6
Graph (Binary Tree) Test0.270.550.350.710.310.63
Multithreading Test0.140.2318.113.89.17.0
All Tests1.01.312.49.06.75.2

The results above show that in general OpenJPA with MySQL server is slightly more efficient than Hibernate with MySQL server in retrieving JPA entity objects from the database.

A large performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (1.2) to the normalized speed of OpenJPA with MySQL database server (2.9) reveals that in that case, OpenJPA with MySQL server is 2.4 times faster than Hibernate with MySQL server.

On the other hand, OpenJPA with MySQL server is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0038) to the normalized speed of Hibernate with MySQL database server (0.34) reveals that in that case, OpenJPA with MySQL server is 89.5 times slower than Hibernate with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test9.310.02.22.05.86.0
Element Collection Test4.86.71.10.532.93.6
Inheritance Test1.52.80.901.61.22.2
Indexing Test0.310.442.12.01.21.2
Multithreading Test1.92.10.990.981.41.5
All Tests3.64.41.51.42.52.9

The results above show that in general Hibernate with MySQL server is slightly more efficient than OpenJPA with MySQL server in executing the tested JPA queries.

On the other hand, Hibernate with MySQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.53) to the normalized speed of OpenJPA with MySQL database server (1.1) reveals that in that case, Hibernate with MySQL server is 2.1 times slower than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test0.740.731.61.61.21.2
Element Collection Test0.0140.391.71.20.870.78
Inheritance Test0.0480.612.02.11.01.4
Indexing Test0.740.813.02.61.91.7
Graph (Binary Tree) Test0.450.690.250.400.350.54
Multithreading Test0.550.632.93.01.71.8
All Tests0.420.641.91.81.21.2

The results above show that in general Hibernate with MySQL server is equivalent to OpenJPA with MySQL server in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.014) to the normalized speed of Hibernate with MySQL database server (0.39) reveals that in that case, Hibernate with MySQL server is 27.9 times faster than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test0.981.11.71.71.41.4
Element Collection Test0.00990.210.650.530.330.37
Inheritance Test0.0330.651.51.80.751.2
Indexing Test0.640.812.02.01.31.4
Graph (Binary Tree) Test0.410.550.430.620.420.58
Multithreading Test0.270.352.94.11.62.2
All Tests0.390.611.51.80.961.2

The results above show that in general Hibernate with MySQL server is slightly more efficient than OpenJPA with MySQL server in deleting JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0099) to the normalized speed of Hibernate with MySQL database server (0.21) reveals that in that case, Hibernate with MySQL server is 21.2 times faster than OpenJPA with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
OpenJPA
MySQL server
Hibernate
MySQL server
Basic Person Test3.63.76.03.64.83.6
Element Collection Test1.31.81.40.841.31.3
Inheritance Test1.01.82.54.31.83.1
Indexing Test1.92.06.64.44.33.2
Graph (Binary Tree) Test0.450.830.400.730.430.78
Multithreading Test2.02.15.55.03.83.6
All Tests1.82.13.93.22.82.7

The results above show that in general OpenJPA with MySQL server is slightly more efficient than Hibernate with MySQL server in performing JPA database operations.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值