本测试对ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping进行了常见的读写测试。本测试证实了try兄之前对NBearV3的性能问题的测试,应该是正确的。NBearV3的3.7X版本,在升级过程中引入一定的性能损失,该性能损失在3.6X应该不存在,我会检查真正的原因。(7/26修订:NBearV3的性能问题已修复,是因为一个很小的代码语句造成的。)本测试同时证实,NBearLite及NBearLite+NBearMapping的ORM方案,平均性能有很大改善。
下载测试程序:
TestNBearPerformance.zip
(7/26修订:代码已更新为修正NBearV3性能问题后的版本)
(2008/1/3修订:NBearLite更新至v1.0.1.0整合NBearMapping版本)
(运行该示例前请修改App.config中的connectionstring,并在tempdb数据库中执行sql目录中的db.sql和data.sql初始化测试数据)
测试内容:
本测试分别测试了小数据两读取、大数据两读取和写操作,返回数据分别填充到DataSet或实体类。
以下是测试结果:
Compare small read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
3 12 5 10 80
Repeat Time = 5
32 27 7 24 63
Repeat Time = 10
29 57 14 49 462
Compare big read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
133 1571 253 110 185
Repeat Time = 5
264 3962 565 282 489
Repeat Time = 10
557 7948 983 557 981
Compare write performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
9 35 25 30 38
Repeat Time = 5
27 94 55 83 96
Repeat Time = 10
58 188 115 166 184
7/26修订:修正NBearV3性能问题后的测试结果如下(虽然NBearV3还是比其他组件略差,但是,没有原来那么夸张):
Compare small read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
3 12 5 14 25
Repeat Time = 5
22 30 7 24 209
Repeat Time = 10
32 60 14 54 174
Compare big read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
121 357 240 131 234
Repeat Time = 5
312 793 559 293 491
Repeat Time = 10
567 1565 796 440 769
Compare write performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping.
Repeat Time = 2
7 29 18 26 34
Repeat Time = 5
16 80 47 72 72
Repeat Time = 10
56 169 91 144 138
2008/1/3修订:NBearLite更新至v1.0.1.0整合NBearMapping版的测试结果:
Compare small read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBe
arLite+NBearMapping.
Repeat Time = 2
11 8 4 20 21
Repeat Time = 5
9 22 5 41 100
Repeat Time = 10
11 80 11 79 202
Compare big read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBear
Lite+NBearMapping.
Repeat Time = 2
66 185 426 66 141
Repeat Time = 5
169 507 343 166 303
Repeat Time = 10
337 985 640 354 598
Compare write performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLit
e+NBearMapping.
Repeat Time = 2
124 23 25 24 35
Repeat Time = 5
14 120 52 91 54
Repeat Time = 10
35 181 106 128 157
--
请使用NBearV3的朋友下载最新的NBearV3.7.2.6版。
欢迎从NBear.org下载NBearLite最新版本。