Do I need to target my application to .NET 4.6 to take advantage of RyuJIT?

醉酒当歌 提交于 2019-11-27 14:07:10

问题


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

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


回答1:


Short answer: no.

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.

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.

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.

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>


来源:https://stackoverflow.com/questions/31529683/do-i-need-to-target-my-application-to-net-4-6-to-take-advantage-of-ryujit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!