NClay数据持化组件性能对比情况
这段时间园子里多了些于关于ORM组件的性能对比情况,于是就把自己编写的NClay框架的数据持久化组件也来出来对比一下。由于自己很懒不想写测试用例于拿Taddy的测试用例代码(http://www.cnblogs.com/teddyma/archive/2007/07/26/831646.html)把NClay的测试代码添加进去希望Taddy见谅。除了测试结果外还通过流程图大概介绍NClay数据持化组件的对象处理流程。
具体测试代码不就贴出来了,可以下载得到。
测试结果:
Compare small read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping,NClay.
Repeat Time = 2
1 6 2 5 7 1
Repeat Time = 5
5 14 3 12 29 3
Repeat Time = 10
8 29 6 25 60 10
Compare big read performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping,NClay
Repeat Time = 2
39 148 119 39 83 37
Repeat Time = 5
103 374 249 102 187 87
Repeat Time = 10
208 748 466 201 379 178
Compare write performance of ADO.NET, NBearV3, NHibernateV1, NBearLite, NBearLite+NBearMapping,NClay
Repeat Time = 2
3 18 8 15 17 4
Repeat Time = 5
8 43 22 39 41 9
Repeat Time = 10
18 88 43 79 78 19
在查询上为什么NClay的结果会比ADO.NET要快?其原因主要是代码和用DataSet作载体有关,事实上NClay也是通过ADO.NET访问数据库的。由于组件封装导致了处理代码集中在性能和优化上都容易得到保证。接下来看下NClay数据持久化组件在处理过程经过那些环节.
NClay框架除了数据持久组件外,还提供适合WIN和WEB下开发MVC组件和AOP织入功能。
框架的用途主要满自己日后的需要,暂时没有开源的考虑。
补上progame说的方案,由于关联处理组件还没有完善,所以用基础的方式实现同样的功能.由order是关键字所以表结构名称上也作了调整
下载测试代码(代码可能各progame描述的有点出入)
测试输出的结果:
=====Test 0=======================
test insert performance use: 2031.25 ms
test typed query performance use: 7609.375 ms
test read performance use: 1625 ms
test load performance use: 31.25 ms
test update all fields performance use: 31.25 ms
test update dirty fields performance use: 46.875 ms
0
0
0
test delete performance use: 1890.625 ms
=====Test 1=======================
test insert performance use: 1968.75 ms
test typed query performance use: 7609.375 ms
test read performance use: 1640.625 ms
test load performance use: 15.625 ms
test update all fields performance use: 46.875 ms
test update dirty fields performance use: 46.875 ms
0
0
0
test delete performance use: 1828.125 ms
=====Test 2=======================
test insert performance use: 2000 ms
test typed query performance use: 8125 ms
test read performance use: 1656.25 ms
test load performance use: 15.625 ms
test update all fields performance use: 46.875 ms
test update dirty fields performance use: 31.25 ms
0
0
0
test delete performance use: 3062.5 ms
=====Test 3=======================
test insert performance use: 1968.75 ms
test typed query performance use: 7640.625 ms
test read performance use: 1625 ms
test load performance use: 15.625 ms
test update all fields performance use: 46.875 ms
test update dirty fields performance use: 46.875 ms
0
0
0
test delete performance use: 1890.625 ms
=====Test 4=======================
test insert performance use: 1968.75 ms
test typed query performance use: 8109.375 ms
test read performance use: 1859.375 ms
test load performance use: 15.625 ms
test update all fields performance use: 46.875 ms
test update dirty fields performance use: 31.25 ms
0
0
0
test delete performance use: 1953.125 ms