我如何prevent NGEN从衍合我的code(负面影响性能)? [英] How do I prevent NGEN from rebasing my code (negatively affecting performance)?

查看:274
本文介绍了我如何prevent NGEN从衍合我的code(负面影响性能)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想加快我的.NET基客户端应用程序,并正在考虑NGEN - 荷兰国际集团的code。

I simply want to speed up my .NET-base client side app and am considering NGEN-ing the code.

杰弗里里氏写这个有关ngening code警告:

Jeffery Richter wrote this warning about ngening code:

•劣质加载时性能   (衍合)。当Windows加载一个   NGend文件,它会检查看看   文件加载在其preferred基地   地址。如果在文件斜面加载其   preferred基址,那么Windows   重新定位该文件,固定,所有的   存储器地址引用。这是   非常耗时,因为   Windows必须加载整个文件到   存储和修改中的各种字节   文件。有关更多信息,   请重订看到我的书:   编程应用微软   Windows中,第4版(微软   preSS)。

•Inferior Load-Time Performance (Rebasing). When Windows loads an NGend file, it checks to see if the file loads at its preferred base address. If the file cant load at its preferred base address, then Windows relocates the file, fixing-up all of the memory address references. This is extremely time consuming because Windows must load the entire file into memory and modify various bytes within the file. For more information about rebasing please see my book: Programming Applications for Microsoft Windows, 4th Edition (Microsoft Press).

由于我不知道很多关于这个话题,我应该知道,在我开始我的项目中更改设置,我应该改变什么设置?

Since I don't know much about this topic, what should I know before I start changing settings within my project, and what settings should I change?

推荐答案

据<一href="http://blogs.msdn.com/b/clrperfblog/archive/2009/07/17/a-primer-on-setting-base-addresses-for-managed-dlls.aspx"相对=nofollow>这个微软博客,有可能是一些边缘的情况下,设置在Vista中+操作系统基址有一个好处,但这些基本上可以忽略。因此,在使用NGEN的确实的减少启动时间,不再需要设置基地址,除非你支持pre-Vista的操作系统。这是新的地址空间布局随机化的安全功能的副作用。

According to this Microsoft blog, "There may be some marginal cases where setting base addresses in Vista+ OSes has a benefit, but these can be largely ignored." So, while using ngen does improve startup times, it is no longer necessary to set the base addresses unless you support pre-Vista OSes. This is a side-effect of the new Address Space Layout Randomization security feature.

这篇关于我如何prevent NGEN从衍合我的code(负面影响性能)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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