千万别这么用linq,超级慢
来源:互联网 发布:网络赚钱兼职正规小虎 编辑:程序博客网 时间:2024/05/17 05:17
为什么linq这么慢,是不是你们这么用了。。。。
且看我的以前错误的例子
List<Custom> lstCus = XMain.GetCustomList();var linq = from _cus in lstCus from _item in dc.Items from _log in dc.LogBook where _cus.RelatedID = _item.RelatdID ..... ...........
各位看官猜执行了多少秒,30秒整整。。。。
优化之后
List<int> lstRid = lstCus.where(x=>x.ModuleID == 8).Select(x=>x.RelatedID).ToList();var linq = from _item in dc.Items from _log in dc.LogBook where lstRid.Contain( _item.RelatdID) ..... ...........
- 千万别这么用linq,超级慢
- Mina重连 千万别这么干
- 这几种人千万别用
- 千万别用MongoDB?
- 那条linq语句为啥这么慢
- 千万别用MongoDB?真的吗?!
- 千万别用MongoDB?真的吗?!
- 千万别用MongoDB?真的吗?!
- 千万别学英语
- 千万别急功近利
- 千万别学英语
- 千万别惹程序员
- 千万别惹程序员
- 千万别惹程序员
- 千万别惹程序员
- 千万别学英语
- 千万别惹程序员
- 千万别理程序员
- linux free -m命令
- 为什么增量必须要是“完成的”
- [转载]程序员该如何去写自己的简历-代码而成的简历@http://blog.csdn.net/phodal/article/details/12908939
- GCC内联汇编基础
- eclipse中复制一行
- 千万别这么用linq,超级慢
- Kinect for Windows SDK开发入门(八):骨骼追踪进阶 上
- 《Example_MarkerBasedAR》中MarkerDetector.cpp源码及详细中文注释
- 宿主开发和交叉开发
- JAVA内存总结
- POJ 1157 LITTLE SHOP OF FLOWERS ( DP )
- SharePoint 2013 App Certificate
- Android中Service与Thread的区别
- ORACLE PL/SQL基础部分-事例