摘要
比较了利用LINQ查询数据库时未预编译和预编译的执行效率。如果将首次执行时的编译结果保存在一个静态类中,在全局范围内只需要编译一次,再次查询时就可以直接使用。结果表明,采用预编译技术能够在很大程度上提高查询效率。
Compared the compiled LINQ query with the without compiled.The first execution of the compiled LINQ query results are stored in a static class,in the global scope,only compile it once and the query can be used directly once again. The results show that using compiled LINQ query can significantly improve the query efficiency.
出处
《电脑编程技巧与维护》
2012年第22期42-43,共2页
Computer Programming Skills & Maintenance