未使用的及QUOT性能的影响;采用"在C#指令 [英] Performance impact of unused "using" directives in C#

查看:130
本文介绍了未使用的及QUOT性能的影响;采用"在C#指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是好奇。

它的问题,如果我在我的code文件的起点,我不会在我的code使用添加多个使用指令。就像这一点。

Does it matter if I add multiple using directives at the starting of my code file which I doesn't use in my code. Like this.

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
//using blah.. blah.. blah..;

public class myClass
{
    // Class members
}

  • 它是否对我的应用程序的内存使用情况不好的影响

    它是否对我的应用程序的业绩不好的影响

    Does it has bad impact on my application's performance.

    我知道这是一个很好的做法,除去他们,我们有短全力支持.NET IDE中这样做,但我只是好奇,想知道这一点。

    I know it is a good practice to remove them and we have short full support of .Net IDE to do so, but I am just curious to know about it.

    推荐答案

    使用指令的,不会对最终的任何内存/性能的影响应用程序 - 它们只是提供编译器的快捷方式来处理长期类型的名称。编译器使用这些命名空间来解析不合格的(或部分限定)类型名称更正类型。

    Extra Using directives will not have any memory/performance impact on final application - they are nothing but compiler provided shortcuts to deal with long type names. Compiler uses these namespaces to resolve unqualified (or partly qualified) type names to correct types.

    这篇关于未使用的及QUOT性能的影响;采用"在C#指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆