Slow performance loading VBNET DLL

301 Views Asked by At

I have a performance issue for some projects I am developing in VBNET. My projects are DLLs, and they are called by an exe with parameters, that is like a tab manager.

The problem is that when I call my first DLL in the exe the InitializeComponent mthod takes to long, but if I open the same DLL from an already loaded DLL it's faster. They are in the same process, in different tabs.

For example, if I open invoice query DLL from the exe takes 10 secs but if I open List of invoices DLL from the exe and then click on an invoice to call invoice query DLL it only takes 2 secs. But if the List of invoices DLL is already loader and I call Invoice Query DLL from a new exe it takes 10 secs again.

I think the main problem is that I'm using DevExpress and GrapeCity (Farpoint Sheet) to create all the controls of my forms, and I think my client has performance problems loading it. But when the first tab is show, the external references are loaded and has no problem with new DLLs in that process. That's the only explenation I know because I added a log in some method and the codeflow is the same, but the same code is faster the second time.

I would like to know if there is anyway to mantain the external references in memory so it can be faster loading the DLLs, or if is there any compile parameter to performe this, or any good practice to make it better.

Edit:

I tried to use NGen, for my DLLs and for DevExpress and GrapeCity DLLs before running, but the performance was the same. I'm not really sure if I need to make any change in my code to make it work. Most pages I checked out says that when you install something with Ngen, it's upload the file into memory. It should be faster, but it's not performing in my app. I only executed install on Ngen, i'm not sure if I need to do something else.

Thanks in advance.

Regards

0

There are 0 best solutions below