views:

40

answers:

1

Hi everybody, we have this problem but can't find a solution. We have an application that references something like 24 dlls. When you invoke the application the very first time (after the application is for any reason reset) it takes 25-40 seconds to start loading contents.

This is what we tried: 1. precompile and publish everything in release mode 2. removing pdbs from bin folder 3. put strong named assemblies into GAC 4. set application to debug = false

Please consider that the whole bin folder is composed by 24 dlls for a total size of 28MB. Just 4 of these dlls are strong named and they are more and less 25MB.

Nothing seems changed. What happens EXACTLY when the application is started is something I couldn't find in any book nor forum/blog/post... What can we monitor more to find where the problem is?

Thanks a lot for your help, Marco

A: 

Looks like you will need to use NGen...

The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.

Precompile the website for deployment, using fixed names, deploy the solution to the server, and then ngen all assemblies in bin

MSDN article on NGen.

Daniel Dyson
Ok, thank you Daniel. I know about JIT but what seems absurd to me is that I have 10 of this applications running on my production server and each of this application references 5 Dll that are in the GAC. Is that possible that JIT compiler compiles EACH DLL referenced by the application even if it was compiled before for another application? What I'm meaning is this: suppose application A that references Test.dll in the GAC. Appplication B references Test.dll too. When I hit the first time application A, JIT takes Test.dll and compiles it. When i hit the first time application B is slow too...
Marconline
About aspnet_compiler.exe I think this is what Visual Studio 2010 does when I publish my application. Am I wrong?
Marconline
Sorry, you are right. I was completely off track. I have edited my answer accordingly.
Daniel Dyson
Wow, that's absolutely a new concept. Seems right for me. Will test and let you know. Thanks a lot.
Marconline