如何改变我想用JIT的类型想用、类型、JIT

2023-09-03 07:57:12 作者:Jelly果冻

我想知道我怎么可以配置我想用JIT的类型。

I am trying to understand how I can configure the type of JIT I want to use.

说,我知道有3种类型的JIT(pre,的Econo和正常)​​。但有以下好奇的问题。

Say, I am aware that there are 3 types of JIT (Pre, Econo and Normal). But have the following curious questions.

什么是与.NET运行在部署服务器的默认JIT?

What is the default JIT with which .NET runs in deployment server?

难道我们能够灵活地更改设置为使用pre或的Econo如果默认是正常的。如果是的话,我可以改变这个?

Do we have the flexibility to change the settings to use either pre or econo if the default is normal. If so where I can change this?

不知道,如果这个设置是在machine.config中还是什么?

Not sure, if this setting is in machine.config or something?

推荐答案

我从来没有听说过的Econo JIT之前。我看到谷歌的链接,它们都指向该说说.NET 1.x的旧文章在节墨的一部分似乎是由不优化生成的机器code之多,并通过跳过IL验证实现的。

I never heard of "Econo jit" before. I do see google links, they all point to old articles that talk about .NET 1.x. The "econo" part seems to be achieved by not optimizing the generated machine code as much and by skipping IL verification.

这个选项当然不会了,因为.NET 2.0存在。只有一种类型的抖动,IL总是被验证,但优化可以被关闭。就像是在你的程序的调试版本中,[可调试]属性控制它。有不同的种的抖动,微软提供的那些可以针对一个x86,64位或ARM处理器。但是,这是一个合乎逻辑的区别,不同的处理器需要不同机器code。抖动的选择是自动的。而关闭的优化变得毫无意义。

This option certainly doesn't exist anymore since .NET 2.0. There is only one type of jitter, IL is always verified but optimization can be turned off. Like it is in the Debug build of your program, the [Debuggable] attribute controls it. There are different kinds of jitters, Microsoft supplied ones can target an x86, x64 or ARM processor. But that's a logical distinction, different processors require different machine code. Jitter selection is automatic. And turning off optimization makes little sense.

pre JIT依然存在,您precompile您的组件与ngen.exe。它采用完全相同的抖动对视了一眼,产生code运行时。它为您的程序提高了热启动的时间,它并不总是最好的解决方案,因为所产生的code是不是很有效,它会减慢冷启动。使用ngen.exe需要编写,运行它在用户的计算机上安装时安装程序。

"Pre jit" still exists, you precompile your assemblies with ngen.exe. It uses the exact same jitter as the one that generates code at runtime. It improves warm start time for your program, it is not always the best solution since the generated code isn't quite as efficient and it slows down cold starts. Using ngen.exe requires writing an installer that runs it at install time on the user's machine.