常规应用程序性能-加快加载时间... [英] General Application Performance - Speeding up Load Times...

查看:65
本文介绍了常规应用程序性能-加快加载时间...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我不确定这是否可行,或者我可能对 .Net 的想法不够,但是我是从过程创建和程序集加载的角度出发的,似乎比我想要的要慢得多.

I'm not sure if this is possible, or if perhaps I'm not thinking .Net enough for the idea, but I'm coming from a perspective of process creation and assembly loading, that appears to be much slower than I would desire. 

在用Delphi或C ++创建Win32 API应用程序(非.Net)并使用Win32 DLL时,我可以静态或动态链接dll,无论哪种方式,在加载时实际上并没有太多明显的问题.应用程序.

When creating a Win32 API application (non-.Net) in say Delphi or C++, and using Win32 DLLs I can statically or dynamically link the dlls and either way it doesn't really have much apparent issue on the loading of the application. 

我目前有几个库程序集,它们是"Engines"(引擎).就像其他控件"所使用的一样应用程序使用的程序集.因此,此应用程序总共有10个程序集. 现在,在调试时,我注意到程序集是按顺序在VS的底部状态栏中向下加载的.有时,由于应用程序桌面非常完整的性质,我并不总是看到启动屏幕.但是当我刚跑步时 该应用程序,而不是通过VS进行调试,但我已经将其安装在另一台计算机上,并且只运行exe的快捷方式,即使在一般的现代系统上,有时也可能需要15或20秒(可能更多)才能显示启动屏幕甚至显示. 在速度较慢的系统上,这甚至可以延长一整分钟.我想知道我将事物分离为外部程序集的设计是否会减慢它的速度.

I Currently have several library Assemblies which are "Engines" as they were that are used by other "control" assemblies that are used by the application.  So IN all effect there are 10 total assemblies to this application.  Now, when debugging, I've noticed the assemblies being loaded in sequence down at the bottom status bar of VS.  and sometimes given the nature of a rather full desktop of applications I don't always see the Splash screen.  However when I just run the application, not through VS for debugging, but i've installed it on another computer and just run the short cut to the exe, and even on average modern systems it can sometimes take 15 or 20 seconds (maybe more) before the splash screen even displays.  On slower systems this can even be extended to a full minute.  I'm wondering if my design of having things separated into external assemblies might be slowing it down.

所以:

A)我是否可以动态加载所需的程序集,如基本上那样,具有主应用程序的启动显示,但随后运行"Assembly.Load(")"程序).对于我需要应用程序的每个dll. 

A) Can I Dynamically Load the required assemblies, like basically, have the splash display for the main app, but then run a "Assembly.Load("")" for each dll that i need for the application. 

B)我正在使用调试"无需优化即可构建.标记优化时,这会极大地影响性能吗?

B) I am using "Debug" builds without optimization.  When flagging optimization will this affect performance greatly?

C)是否有某种攻击方法或计划会影响应用程序的加载时间? (我只是在谈论加载,我仍然必须进行数据库连接测试和加载等,所以我对此并不在意,但是我不必等待 启动屏幕的分钟.飞溅应该是即时的或尽可能接近的.

C) Is there some method or plan of attack for affecting the load times of an application?  (I'm just talking about loading up, i still have to database connection tests, and loads, etc, so I'm not concerned with that, but i shouldn't have to wait a minute for the splash screen.  the splash should be instant or as close to as possible).

谢谢

Jaeden"Sifo Dyas" al'Raec Ruiner

Jaeden "Sifo Dyas" al'Raec Ruiner

推荐答案

 

 

您好JaedenRuiner,

Hi JaedenRuiner,

A)是的,MEF框架正是出于这个原因而设计的;只加载您需要的东西.您还可以将dll加载到工作目录中,然后将其加载到IoC容器中(例如Entlib中的Unity.

A) Yes you can, the MEF framework is designed exactly for this reason; only load stuff that you need. You could also load dll's in a working directory and have them loaded into your IoC container (such as Unity from Entlib.

B)不,根据我的经验,它不会运行得更快

B) no, in my expierence it will not run any faster

C)是.使用IoC容器或MEF延迟加载依赖项.

C) Yes. Have the dependencies loaded lazily using an IoC container or using MEF.

请查看

Have a look at http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx for more information regarding getting started with MEF.

亲切的问候,
汤姆·德·科宁(Tom de Koning)

Kind regards,
Tom de Koning


这篇关于常规应用程序性能-加快加载时间...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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