惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Vercel News
Vercel News
F
Fortinet All Blogs
月光博客
月光博客
G
Google Developers Blog
博客园 - Franky
GbyAI
GbyAI
The Cloudflare Blog
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
小众软件
小众软件
腾讯CDC
B
Blog
量子位
V
V2EX
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News

博客园 - 糊涂小猪

ASP.NET页面请求流程 工作气氛 程序员的人生 利用reflector工具导出工程文件 按评论数排序会出现两个一模一样的文章,是BUG么? ORACLE中按长度分割字符串(保持单词完整性和数值完整性) CLS理解 starteam 中文手册 不会技术的比会技术的好混,啥世道现在!! 自定义COMBOBOX控件 ORACLE中批处理的执行 日志文件的生成 C#取得当前窗体图片 MENUITEMS中一个被忽略的属性 继承CollectionBase来扩展自定义的集合类型 C#继承机制 C#中对ini文件的操作。 C#中提取字符串的解决方法 C#中的[DllImport("kernel32.dll")]的意思是啥?困惑ing。
Start without Debugging VS start
糊涂小猪 · 2006-08-29 · via 博客园 - 糊涂小猪

   相信大家在编译程序的时候,不会去注意Start without Debugging VS start这两个编译的效率有什么不同?

上网看了好多的文章,其中有一个是介绍用到BITMAP的时候,用如上两种运行的效率差的非常的多。原文如下:

Performance drops dramatically for me in VS2005, if I run something in debug-mode. It does not matter, if I compiled a debug version or a release version, just clicking "start debugging" instead of "start without debugging" makes things slow. I found out, that all of my performance problems are related to System.Drawing.Bitmap - it might be a new debugging option concerning interop, but I did not find it.

An example:

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
System.Drawing.Bitmap b = new System.Drawing.Bitmap(1000, 1000);
int bla = 0;
for (int x = 0; x < 1000000; ++x) bla = bla + b.Width;
}
}
}

This takes not even a second when I "start without debugging". It's as fast in VS2003, either with or without debugging. But it takes 10 seconds with debugging in VS2005.
I could actually bypass all debugging performance problems but one: Loading a single texture with managed DirectX (for .Net 1), using a Bitmap object takes half a minute.

Any hints? Could somebody test, if this problem is common?

但是除了上面介绍到的用到BITMAP的时候效率有别之外,不知道还有没其他的地方还有影响。

到现在我还不是很清楚,这两个在编译代码的时候还有何区别?