We say that I load form1 and then show this button, which gives me the form 2,3 and 4 Have to do
Now, when I click on the button to load Form 2, I can see that some class libraries (.dl) take a while to load, which looks unresponsive to the UI .
As long as the libraries are not loaded, Form 1 is still being shown, as long as I do not load class libraries. But after that, it's pretty fast
so how can I pre-load class libraries, maybe when the app starts?
I use the to form1 and the statements compact framework is so good that it will not actually load until it is required for Form 2. I'm talking about 2 seconds of delay but still looks bad.
Is there any way to overcome this problem? System DL, which can be forced to load my DLL file to the system. Loading of windows.org form DLL?
Update:
I have my own class library Assembly.LoadFrom but I am still unable to load the following files when Form1 loads
Microsoft.WindowsMobile.PocketOutlook.dll
Microsoft.WindowsCE.Forms.dll
Microsoft.WindowsMobile.Utilities. Dll
System.Xml.dll
Is this possible? :)
This is not about "loading class library" compiled machine code from IL) first Once you show your form, Runtime has to do JIT for all the codes to create examples of its class. Apart from this, the constructor is also going to run. After this, it can only be shown, and even to load a new instance, the jute code can be already cached and ready to run, whose This means that no compilation is necessary.
To get the best "visible" performance, when the user clicks on a button at the minimum, you want to keep the quantity of jute if your form requires some services or objects , Then pre-load them in the background thread, so that they are ready when the form is ready.
Without knowing a little more about what you are loading, when you are loading it, and your form needs to be actually displayed, give you more detailed directions. Is difficult in
Edit
It can see something like this:
class MyForm {static void main () (New thread (Representative {AppInitialize ();}} {IsBackground = true}. Start (); Application. (New MyForm ());} Fixed Zero AppInitialize () {// Load Application-wide processing, services, etc.} Public MyForm () {InitializeComponent (); ThreadPool.QueueUserWorkItem (Representative {InitializeServices ();})}} zero initializeServices () {// loading / need to load form after first rendering}} Again, because I know It is only what you are doing, this may need to be different for your application. I also use IoC container framework, so my code looks very different, basically I use the same concepts, though .
Comments
Post a Comment