我是否需要针对我的应用程序到.NET 4.6采取RyuJIT的优势?我的、应用程序、优势、NET

2023-09-05 00:16:20 作者:寂寞式丶

从阅读公布的.NET Framework 4.6 这似乎在暗示,RyuJIT只适用于.NET 4.6。

Reading from Announcing .NET Framework 4.6 it seems to imply that RyuJIT is only for .NET 4.6.

这是否意味着我将需要重新定位我的应用程序到.NET 4.6 RyuJIT生效?

Does that means I will need to re-target my applications to .NET 4.6 for RyuJIT to take effect?

推荐答案

简短的回答:没有

龙答:使用调试器,以确保您有新的版本。首先来看看,看到在使用资源管理器运行时目录,定位到C:\ WINDOWS \ Microsoft.NET \ Framework64 \ v4.0.30319。你会找到两个有抖动, clrjit.dll 是一个基于Ryujit项目新的抖动和 compatjit.dll 是传统的x64抖动。

Long answer: use the debugger to ensure you have the new version. First have a look-see at the runtime directory with Explorer, navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319. You'll find the the two jitters there, clrjit.dll is new jitter based on the Ryujit project and compatjit.dll is the legacy x64 jitter.

项目>属性>调试>勾选启用本地code调试选项。使用Build选项卡,并确保已删除了抖动强迫的preFER 32位选项必须取消选中平台目标必须设置为值为anycpu。并使用应用程序选项卡挑框架的目标。

Project > Properties > Debug > tick the "Enable native code debugging option". Use the Build tab and ensure you've removed the jitter forcing, the "Prefer 32-bit" option must be unticked, "Platform target" must be set to AnyCPU. And use the Application tab to pick the framework target.

使用调试>单步开始调试。调试>窗口>显示模块加载模块的列表。查找抖动的DLL早在该列表中,单击名称列标题,按名称排序。如果你看到 compatjit.dll 当时使用的是传统的抖动。请注意,你会经常看到clrjit.dll,他们都在传统的抖动时被装入。

Use Debug > Step Into to start debugging. Debug > Windows > Modules displays the list of loaded modules. Find the jitter DLLs back in that list, click the "Name" column header to sort by name. If you see compatjit.dll back then you are using the legacy jitter. Do note that you'll always see clrjit.dll, they both get loaded when the legacy jitter is used.

使用传统的x64抖动故意,要么需要COMPLUS_us​​eLegacyJit环境变量或在HKLM或HKCU \软件\微软\ .NETFramework注册表项中useLegacyJit值或app.exe.config文件条目:

Using the legacy x64 jitter intentionally requires either the COMPLUS_useLegacyJit environment variable or a useLegacyJit value in the HKLM or HKCU\Software\Microsoft\ .NETFramework registry key or an app.exe.config file entry:

<runtime>
  <useLegacyJit enabled="1"/>
</runtime>