.NET内部工作 [英] .NET Internal Workings

查看:80
本文介绍了.NET内部工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经取出了我的主要代码的一部分,并把它放在一个单独的dll中

libaray。


我的问题是有没有通过引用一个dll

库来实现任何性能,假设所有人都在一个exe中?


谢谢

Howard

I''ve taken out a portion of my main code and put it in a seperate dll
libaray.

My question is would there be any performance hit by referencing a dll
library as suppose to all in one exe?

Thanks
Howard

推荐答案

我的问题是,如果引用一个dll
库就会有任何性能损失?
My question is would there be any performance hit by referencing a dll
library as suppose to all in one exe?




可能没什么大不了的。

Mattias


-

马蒂亚斯Sj的格伦[C#MVP]马蒂亚斯@ mvps.org
HTTP? //www.msjogren.net/dotnet/ | http://www.dotnetinterop.com

请回复到新闻组。



Probably nothing significant.
Mattias

--
Mattias Sj?gren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.





没有什么可以失去睡眠的。

-

-

Ignacio Machin,

ignacio.machin at dot.state.fl.us

Florida Department交通运输


" Howard" <豪******* @ yahoo.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP03.phx.gbl ...
Hi,

Nothing to lose the sleep for.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Howard" <ho*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
我'已经取出了我的主要代码的一部分,并把它放在一个单独的dll
libaray。

我的问题是,引用dll
库会有任何性能损失假设所有人都在一个exe中?

感谢
Howard
I''ve taken out a portion of my main code and put it in a seperate dll
libaray.

My question is would there be any performance hit by referencing a dll
library as suppose to all in one exe?

Thanks
Howard



" Howard" <豪******* @ yahoo.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP03.phx.gbl ...
"Howard" <ho*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
我'已经取出了我的主要代码的一部分,并把它放在一个单独的dll
libaray。

我的问题是,引用dll
库会有任何性能损失假设一个exe中的所有人?


这一切都得到JIT编译的方式相同。


最佳:只在你的.exe中放入最小的启动代码,所以你可以尽快开始

(设置一个闪屏,开始听插座,

或其他什么 - 这是打破/削弱的一个正当理由
封装)。虽然静态构造函数在引用

问题中的代码之前不会运行,但PEVerify必须分析整个装配单元

一次。将受信任的代码放在一个单独的程序集中,使用强名称签名,并且使用GAC
,这样PEVerify就不必每次都运行 - 它会缓存结果

并且只要程序集没有被修改,它就可以跳过重新验证。

如果没有管理,请使用locality来帮助分割你的应用程序(

相同的库中的代码应该一起使用,以最小化工作集)...我

不知道这将如何适用于托管代码 - 因为它得到JIT

编译,它可能会改善很多地方。

谢谢
霍华德
I''ve taken out a portion of my main code and put it in a seperate dll
libaray.

My question is would there be any performance hit by referencing a dll
library as suppose to all in one exe?
It all gets JIT compiled the same either way.

Best: put only the minimal startup code in your .exe, so you can get going
as quickly as possible (put up a splash screen, start listening to sockets,
or whatever -- this is one legitimate reason for breaking/weakening
encapsulation). Although static constructors don''t run until the code in
question is referenced, PEVerify has to analyze the whole assembly unit at
once. Put trusted code in a separate assembly, signed with strong name, and
use GAC, so that PEVerify won''t have to run each time -- it caches results
and as long as the assembly isn''t modified, it can skip reverification.
WIth unmanaged, use locality to help segment your application (code in the
same library should be used together, to minimize the working set)... I
don''t know how this would apply to managed code -- because it gets JIT
compiled, it probably improves locality a lot.

Thanks
Howard



这篇关于.NET内部工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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