预紧所有组件(JIT) [英] Preload all assemblies (JIT)

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

问题描述

我们正在一击首次一些沉重的UI界面加载。我们的项目分为一主执行程序和几个DLL文件。该DLL文件还可以包含哪些是缓慢的,他们是第一次加载UI界面。

We are taking a hit the first time some heavy UI screens are loaded. Our project is divided into one main executable and several DLL files. The DLL files can also contain UI screens which are slow the first time they are loaded.

有没有办法(代码),我们可以预载的所有引用的程序集,从而避免JIT编译命中?

Is there a way (in code) we can preload all the referenced assemblies so as to avoid the JIT compilation hit?

我知道有一个叫工具的 NGEN 。是否有可能在开发环境中运行NGEN,所以我们可以立即看到它的效果如何?理想的情况下,虽然,我们想预加载从代码中引用的程序集。

I know there is a tool called NGen. Is it possible to operate NGen in a development environment so we can see its effects instantly? Ideally though, we would like to preload the referenced assemblies from code.

使用C#与DevExpress的一起.NET 3.5为我们的UI组件。

Using C# .NET 3.5 along with DevExpress for our UI components.

推荐答案

看看 NGEN 。另一种选择是使用 ILMerge 到所有组件合并成一个。每当我使用ILMerge,我添加了一个后生成命令,所以它会自动发生。另一种方法(未经测试),如果你不介意一个较长的启动时间,你可以手动在开始时每个组件调用的Assembly.Load()。

Take a look at NGen. Another option is to use ILMerge to merge all your assemblies into one. Whenever I use ILMerge, I add a post build command to so it happens automatically. The other alternative (untested) is, if you don't mind a longer start-up time, you could manually call Assembly.Load() at the beginning for each assembly.

这篇关于预紧所有组件(JIT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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