带有 .NET 可执行文件的 NGEN x86 与 x64

编程入门 行业动态 更新时间:2024-10-11 03:24:10
本文介绍了带有 .NET 可执行文件的 NGEN x86 与 x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下问题:

我的 .NET 程序集是在 x86 模式下编译的.我还能在 x64 Windows 系统上利用 NGEN 的性能优势吗?x86 程序集会在 x64 上编译成本机代码吗?

My .NET assemblies are compiled in x86 mode. Can I still leverage the performance benefits of NGEN on x64 Windows systems? Will x86 assemblies be compiled into native code on x64?

推荐答案

使用 x86 编译的程序集将在 64 位系统上运行 i wow64,但使用 AnyCPU 编译的程序集将在本机运行,与 NGEN 无关.为 x86 编译的程序集可以在 64 位系统上加载 32 位程序集,而为 AnyCPU 编译的代码不会加载 32 位 dll.

Assemblies compiled with x86 will run i wow64 on 64-bits systems, but assemblies copiled with AnyCPU will run natively, regardless of NGEN. Assemblies compiled for x86 can load 32-bit assemblies on 64-bit systems and code compiled for AnyCPU will not load 32-bit dlls.

当您使用 NGEN 时,您将避免对程序集进行 JIT 编译,并且在 x64 系统上也使用 x86 编译时,程序集将是本机 x86 代码.

When you use NGEN you will avoid JIT-compiling of the assembly and the assembly will be native x86 code when compiled with x86 also on x64 systems.

更多推荐

带有 .NET 可执行文件的 NGEN x86 与 x64

本文发布于:2023-10-29 00:23:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538190.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可执行文件   NET   NGEN

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!