删除评论可以帮助应用程序更快地运行? [英] Deleting the commented can help the application to run faster?

查看:84
本文介绍了删除评论可以帮助应用程序更快地运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的源代码大小为8Gb,因为很多注释代码都存在。应用程序也很慢所以如果我删除注释代码可以提高性能吗?



我在哪里可以检查性能路障?

My source code is of size 8Gb in that lots of commented code is there.The application is also slow so if i delete the commented code can i increase the performance??

Where can i check for the performance road blocks??

推荐答案

不!注释不会影响程序的执行速度。特别是在C#中,注释不会被解析为编译器。它们在词法分析中被淘汰。



但是,不要保留不必要的注释文件。评论的主要目的应该是记录您的代码。虽然,它与你的应用程序/程序的性能无关。



你可以检查这是使用 IL反汇编程序 [ ^ ]。



我希望它有用,如果对此主题有任何进一步澄清,请回复:)
No ! Comments do not effect execution speed of a program. Particularly in C#, comments are not parsed to the compiler. They are eliminated in the lexical analysis.

But, do not keep commented files which are not necessary. The main purpose of comment should be document your code. Although, it has nothing to with the performance of your application/program.

You can check this is using IL Disassembler[^].

I hope it was helpful and incase any further clarification required on this topic please reply :)


评论没有由于编译器忽略它们对运行时性能的影响。



如果您有8GB的.net源代码,那么您的问题远远大于性能。



首先放大你的用户说使用分析器的系统速度慢的地方并处理花费大部分时间的位(这假设你已经正确编写了算法,这是大多数他们通过改造你的工作时间来获得时间,你可以获得比微优化方法多10倍以上的性能。
Comments have no effect on runtime performance since the compiler ignores them.

If you have 8gb of .net source code then your problems are far greater than performance.

Start by zooming in where your users say the system is slow with the use of a profiler and work on the bits that take most time (this presumes that you have written your algorithms correctly, which most of them time by reworking how you do things you can gain ~10x+ time more performance than micro optimizing methods).


您好,



请查看以下链接:

http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ [<一个href =http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/target =_ blanktitle =新窗口> ^ ]



http:// msdn.microsoft.com/en-us/library/3xxk09t8%28v=vs.100%29.aspx [ ^ ]



10 ASP.NET性能和可伸缩性秘密 [ ^ ] br />


问候,

Praneet
Hi,

Please have a look at the following links:
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/[^]

http://msdn.microsoft.com/en-us/library/3xxk09t8%28v=vs.100%29.aspx[^]

10 ASP.NET Performance and Scalability Secrets[^]

Regards,
Praneet


这篇关于删除评论可以帮助应用程序更快地运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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