发布版本未优化 [英] Release build not optimizing

查看:80
本文介绍了发布版本未优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MSBUILD构建winform的发布和调试版本

项目(VS.NET 2005)。项目文件有条件提交

参考DLL,具体取决于构建配置(debug或

发布)。生成的用于发布的EXE PDB文件比调试版本的b / b
小2KB。但是,EXE的大小完全相同。

Release设置为优化代码,但为什么这些EXE的大小相同?

程序也会加载相同的版本。发布应该更快




谢谢,

Brett

I''m using MSBUILD to build release and debug versions of a winform
project (VS.NET 2005). The project file has conditionals to file
reference DLLs depending on the build configuration (debug or
release). The generated EXE PDB file for release is 2KB smaller than
the debug version. However, the EXEs are exactly the same size.
Release is set to optimize code but why are these EXEs the same size?
The program also loads the same with both versions. Release should be
faster.

Thanks,
Brett

推荐答案

释放设置为优化代码,但为什么这些EXE的大小相同?

也许对齐?
Release is set to optimize code but why are these EXEs the same size?
Alignment perhaps?

发布应该更快。
Release should be faster.



然而,这不是一个改变;特别是如果您将调试器外部的DEBUG

与调试器外的RELEASE进行比较,那么您如何测量[非]更改?


我要检查的主要是:MSBUILD输出是否与VS输出一致?
?要检查你是否有正确的MSBUILD参数(没有轻微的

意图)。


Marc

It isn''t a step-change, however; especially if you are comparing DEBUG
outside the debugger to RELEASE outside the debugger, How are you
measuring the [non-]change?

The main thing I would check is: is the MSBUILD output consistent with
the VS output? To check you have the right MSBUILD params (no slight
intended).

Marc

5月28日晚上9点,Marc Gravell< marc.grav ... @ gmail.comwrote:
On May 28, 9:00 pm, Marc Gravell <marc.grav...@gmail.comwrote:

Release设置为优化代码,但为什么这些EXE的大小相同?
Release is set to optimize code but why are these EXEs the same size?



或许对齐?


Alignment perhaps?


发布应该更快。
Release should be faster.



然而,这并不是一个改变。特别是如果您将调试器外部的DEBUG

与调试器外的RELEASE进行比较,那么您如何测量[非]更改?


It isn''t a step-change, however; especially if you are comparing DEBUG
outside the debugger to RELEASE outside the debugger, How are you
measuring the [non-]change?



文件大小(字节)。

File size in bytes.


>

主要的东西我会检查的是:MSBUILD输出是否与VS输出的​​
一致?
>
The main thing I would check is: is the MSBUILD output consistent with
the VS output?


>通过查看DLL和PDB文件大小我可以看出,它是
>From what I can tell by looking at DLL and PDB file sizes, it is the



一致。

consistent.


>检查你是否有正确的MSBUILD参数(没有轻微的

意图)。


Marc
>To check you have the right MSBUILD params (no slight
intended).

Marc



VS.NET也生产相同大小的EXE。是不是只是按照我的方式使用

MSBUILD?


当我在VS.NET中构建调试版本时,项目文件引用

调试版本的DLL。当我构建发布版本时,我将更改DLL以引用它们的发行版本。我正在做

所有这一切只是为了测试它们为何相同。

VS.NET is producing the same size EXEs as well. Isn''t that just using
MSBUILD the same way I am?

When I build the debug version in VS.NET, the project file references
debug versions of the DLLs. When I build the release version, I
change out the DLLs to reference their release versions. I''m doing
all of that just to test why they are the same.


Brett Romero< ac * ****@cygen.comwrote:
Brett Romero <ac*****@cygen.comwrote:

我正在使用MSBUILD构建winform的发布和调试版本

项目( VS.NET 2005)。项目文件有条件提交

参考DLL,具体取决于构建配置(debug或

发布)。生成的用于发布的EXE PDB文件比调试版本的b / b
小2KB。但是,EXE的大小完全相同。

Release设置为优化代码,但为什么这些EXE的大小相同?

程序也会加载相同的版本。发布应该更快。
更快。
I''m using MSBUILD to build release and debug versions of a winform
project (VS.NET 2005). The project file has conditionals to file
reference DLLs depending on the build configuration (debug or
release). The generated EXE PDB file for release is 2KB smaller than
the debug version. However, the EXEs are exactly the same size.
Release is set to optimize code but why are these EXEs the same size?
The program also loads the same with both versions. Release should be
faster.



你假设更小==更快。你有没有把它们计时到

看看发布版本*是否*更快?


请注意,.NET中的大部分优化都是执行的无论如何,由JIT

编译器,而不是C#编译器。


-

Jon Skeet - < sk ** *@pobox.com>
http://www.pobox.com/~双向飞碟博客: http://www.msmvps.com/jon.skeet

如果回复小组,请不要给我发邮件

You''re assuming that smaller==faster. Have you actually timed them to
see whether the release build *isn''t* faster?

Note that most of the optimisation in .NET is performed by the JIT
compiler anyway, rather than the C# compiler.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


这篇关于发布版本未优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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