本机图像生成 [英] Native Image Generation

查看:82
本文介绍了本机图像生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我想知道在我使用ngen.exe编译.exe或.dll程序集之后,该二进制文件在哪里?我有一个.NET 4程序集(在C#中),并且想要删除MSIL并保留本机代码以在运行时绕过JIT编译.我在命令行编译器中执行此操作:

Hello!

I wonder where is the binary file located after Ive compiled the .exe or .dll assembly using the ngen.exe. I have a .NET 4 assembly (in C#) and want to remove MSIL and leave the native code to bypass JIT compilation at runtime. I do this in command line compiler:

ngen install myAssemblyName.exe



它批准已安装在本机图像缓存中,但我不知道它在哪里.有人可以帮忙吗?

感谢



and it approves to have installed in native image cache but I dont know where it is. Can anyone help?

Thanks

推荐答案

据我了解,您永远不需要知道这一点.您没有在缓存中直接使用本机映像.您将继续使用相同的程序集可执行模块文件来运行您的应用程序,就像使用Native Image Generator之前一样.生成的本机映像仅在运行时使用,以防止通过使用预编译的本机代码进行JIT操作.您可能只会看到性能上的差异(不要指望会得到重大改进,因为JIT对于大多数应用程序都足够有效).

您可以阅读有关使用本机映像的其他影响的信息:
http://msdn.microsoft.com/en-us/library/6t9t5wcf%28v = vs.100%29.aspx [ ^ ].



本机映像通常被命名为"* .ni.dll","*.ni.exe".



这是一篇不错的深入的Microsoft Magazine文章: http://msdn.microsoft.com/en-us /magazine/cc163610.aspx [ ^ ].

—SA
As far as I understand, you never need to know that. You are not using the native image in cache directly. You will keep using the same assembly executable module file to run your application, exactly as you would do before using Native Image Generator. The generated native image will only be used during run time to prevent JIT operation through using pre-compiled native code. You may only see the difference in performance (do not expect dramatic improvements because JIT is effective enough for most applications).

You can read about other effects of using the native image:
http://msdn.microsoft.com/en-us/library/6t9t5wcf%28v=vs.100%29.aspx[^].



Native images are typically named like "*.ni.dll", "*.ni.exe".



This is a good in-depth Microsoft Magazine article: http://msdn.microsoft.com/en-us/magazine/cc163610.aspx[^].

—SA


这篇关于本机图像生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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