Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I noticed that even the most basic Winform application (ie. just a window, with no extra modules) still takes several seconds to load after creating its machine code equivalent through Ngen. I guess then that the bottleneck is loading the .Net framework from disk.

Microsoft's CacheSet doesn't allow managing the actual contents of the disk cache.

Is there an application that can force Windows to keep the main .Net files in its disk cache, as a work-around to slower startup time for .Net applications?

Thank you.


Edit: Here's the screenshot of Process Monitor's Process Timeline: enter image description here

share|improve this question
3  
You "guess" that the bottleneck is in loading the .NET framework. Have you tried confirming this by using something like Spy++ or Performance Monitor (set it to monitor something like disk reads), or are you only guessing at and trying to find a solution to what you guess is the cause of the startup delay? –  Michael Kjörling Jul 9 '12 at 12:12
add comment

1 Answer

The .NET framework does have a slight lag the first time the framework is loaded into memory, but nothing of the scale you speak of. Are you running with a debugger?

Alternatively you can see whether signed .NET assemblies are trying to get to crl.microsoft.com, which can introduce a delay depending on network conditions. Use Process Monitor for this.

In fact, Process Monitor will identify for you, step by step, what's happening when you run something, and you can narrow down the problem much easier than guessing.

share|improve this answer
    
Thanks for the tip. I ran Process Monitor to watch what a basic VB.Net app does. I added a screenshot of the Process Timeline. The File Summary shows a total File Time of 45.60, but I don't know what this means and if it explains why a cold start takes several seconds while a Freebasic equivalent loads in a split second. –  OverTheRainbow Jul 10 '12 at 11:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.