JIT编译问题 [英] JIT compilation question

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

问题描述

你好,


我昨天发布了这个作为后续问题,但没有人咬过:


是.Net应用程序每次运行
时重新编译(即从CIL到本机代码)?或者缓存本机代码 - 如果是,那么在哪里?谢谢。

Hello,

I posted this as a follow-on question yesterday, but nobody has bitten:

Is a .Net application recompiled (i.e. from CIL to native code) each time it
is run? Or is the native code cached - and if so, where? Thanks.

推荐答案

它只编译一次,然后存储在本机程序集缓存中,

或其他东西。

您也可以使用ngen.exe自行预编译

但是它有点复杂。

整个应用程序都没有编译直到部件需要,所以

初始启动时间足够快,但是你第一次做新东西时可能会遇到减速

,比如获得新的异常。


-

hotmail帐户很可能不会被阅读,所以请只回复

给新闻组。
It is compiled only once, then it is stored in the native assembly cache,
or something.
You can precompile it yourself too with ngen.exe
But it gets a little more complicated.
The whole application isn''t compiled until the parts are needed, so the
initial startup time will be fast enough, but you may encounter slowdowns
the first time you do new stuff, like getting a new exception.

--
The hotmail account will most likely not be read, so please respond only
to the news group.


第一次调用时,每个方法都是JIT编译的,JIT'代码

不是持久的,它只是简单的缓存在内存中并一直存在,直到

程序结束(应用程序域卸载)。


Willy。


希拉琼斯 < SH ********** @ btopenworld.com>在消息中写道

新闻:%2 ****************** @ TK2MSFTNGP09.phx.gbl ...
Each method is JIT compiled when called for the first time, the JIT''d code
is NOT persisted, it''s simply cached in memory and remains there until the
program ends (application domain unloads).

Willy.

"Sheila Jones" <sh**********@btopenworld.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
您好,

我昨天发布了这个作为后续问题,但没有人咬过:

每次重新编译.Net应用程序(即从CIL到本机代码)
它运行了吗?或者缓存本机代码 - 如果是,那么在哪里?谢谢。
Hello,

I posted this as a follow-on question yesterday, but nobody has bitten:

Is a .Net application recompiled (i.e. from CIL to native code) each time
it
is run? Or is the native code cached - and if so, where? Thanks.



感谢您的回复。我知道方法只是编译它们被调用的第一个

时间,我只是不知道CLR是否忘记了应用程序终止后编译的一切

。你说它存储了

本机代码。


我想后续问题是:CLR如何知道缓存的

本机代码仍然有效,例如,.exe没有用更新版本替换


" Morten Wennevik" <莫************ @ hotmail.com>在消息中写道

news:op ************** @ msnews.microsoft.com ...
Thanks for the reply. I knew about methods only being compiled the first
time they are called, I just didn''t know whether the CLR forgot everything
it had compiled when the application terminated. You say it stores the
native code.

I suppose the follow-on question is: how does the CLR know that the cached
native code is still valid and that, for example, the .exe hasn''t been
replaced with an updated version?
"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:op**************@msnews.microsoft.com...
它只编译一次,然后它存储在本机程序集缓存中,
或其他。
您也可以使用ngen.exe自行预编译
但它会变得更复杂。
整体应用程序在需要部件之前不会编译,因此初始启动时间足够快,但是第一次执行新操作时可能会遇到速度减慢,例如获得新的异常。 br />
-
Hotmail帐户很可能无法阅读,因此请仅回复新闻组。
It is compiled only once, then it is stored in the native assembly cache,
or something.
You can precompile it yourself too with ngen.exe
But it gets a little more complicated.
The whole application isn''t compiled until the parts are needed, so the
initial startup time will be fast enough, but you may encounter slowdowns
the first time you do new stuff, like getting a new exception.

--
The hotmail account will most likely not be read, so please respond only
to the news group.



这篇关于JIT编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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