我能避免JIT在.NET [英] Can I avoid JIT in .net

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

问题描述

说,如果我的code总是将要在一个特定的处理器上运行,如果我在安装过程中有这样的信息 - 没有任何机会,我会避免JIT

Say if my code is always going to be run on a particular processor and if I have this information during installation - is there any chance I can avoid JIT?

推荐答案

您不必避免JIT,如果你有在安装CPU信息。

You don't have to avoid JIT if you have CPU information at installation.

如果您编译使用/平台的模块:在x86 / x64 / IA64]开关,编译器将包括在生成的PE文件此信息,以便CLR将JIT的code到相应的CPU本地code和优化code为CPU架构。

If you compile your modules using the /platform:[x86/x64/IA64] switch, the compiler will include this information in the resulting PE file so that the CLR will JIT the code into the appropriate CPU native code and optimize the code for that CPU architecture.

您可以使用 NGEN ,是但前提是你要提高应用程序的启动,作为一个结果,减少了工作集的进程中运行不监守你会避免JITting。而你需要真正的NGEN'd文件对业绩的非NGEN'd文件比较,以确保该NGEN'd之一就是快。

You can use NGEN, yes but only if you want to improve the application's startup as a result of the reduced working set in the processes running not becuase you would have avoided JITting. And you need to actually compare the NGEN'd files' performance against that of the non-NGEN'd files' to make sure that the NGEN'd one is faster.

NGEN不能让尽可能多的假设,对执行环境的JIT编译器可以,因此会产生未优化code。

NGEN can't make as many assumptions about the execution environment as the JIT compiler can and therefore will produce unoptimized code.

例如:它增加了间接性的,因为实际的静态字段访问 静态字段的地址,只能在运行时是已知的。

For example: it adds indirections for static field access because the actual address of the static fields is known only at run time.

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

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