最近在使用sps类库过程中发现了一个让我比较疑惑的问题(有关items属性的)

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

大家都知道 SPList对象有个属性 items ,在文档中是这样解释的

The Items property of the SPList class gets the collection of all items in the list. Remarks返回当前 List中的所有的item对象集合

The Items property returns all the files in a document library, including files in subfolders, but not the folders themselves. In a document library, folders are not considered items. 在一个document library(文档库)中返回其下所有的文件不包括其目录。

我们在做一个项目,使用wss做后台存储,开发环境数据库中现在有大概2G多的数据,其中主要用的是list 和 document library 站点下大概有查不多1000来个list和 document library ,测试发现性能极其差,每个操作大都需要几秒钟左右,后来反复测试才发现问题处在---- List.Items 属性返回 的时间大概都要用4秒来钟,这弱智得东西,这不是坑人嘛。后来我把这个属性换成GetItems(Microsoft.SharePoint.SPView) 方法(The GetItems method of the SPList class returns a collection of list items from the list based on the specified view. )

具体我是这样用的objList.GetItems(objList. DefaultView),再次测试结果发现返回items集合只用了0.3秒左右的时间。

我就不明白了~都是同一家公司出的如此相似的两个操作性能差距砸就那大尼。

看来以后items属性千万不能用 ,直接cut掉得拉

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航