O.O*_*O.O 11 c# asp.net performance
在Visual Studio中,有一个命令可以删除未使用的using语句
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
Run Code Online (Sandbox Code Playgroud)
使用未使用的产品是否会受到性能影响?
代码文件中使用的命名空间数量不会影响应用程序的运行时性能.它确实会对编译时产生影响,因为编译器必须在这些命名空间中搜索其他项,例如类型和扩展方法.
唯一的运行时影响我所知道的名称空间的数量
不会。命名空间用于在编译时解析类名。编译后,您的程序集仅包含完全限定的类名System.Collections.Generic.List<int> myList = new System.Collections.Generic.List<int>(),例如 ,所有使用都消失了。
| 归档时间: |
|
| 查看次数: |
2359 次 |
| 最近记录: |