1

We have a VB6 app that launches our .NET code upon startup.

Cold start takes about 22 seconds consistently on a Windows XP machine. Warm start is about 4 seconds on the same machine.

Windows Vista/7 takes about 5 seconds for a cold start and about 3 seconds for a warm start.

Based on the above, I'm assuming the delays are disk access related and Vista/7 isn't as affected due to SuperFetch.

Obviously, we need to improve cold start performance for XP. I'm considering creating a "warmup" app that runs in the system tray on Windows startup...but before we spend the effort, I wanted to see if there are any other suggestions.

I've tried ngen'ing our assemblies and that seems to make no difference whatsoever.

Upon adding some tracing code, I can see it only takes about 1 second for the VB6 code to cross the .NET boundary...but the initialization code in .NET takes about 20 seconds. It does some reflection and I'm guessing the delay is loading GAC assemblies from disk...but I can't be entirely sure.

Suggestions?

Jeff
  • 35,755
  • 15
  • 108
  • 220
  • possible duplicate of [Is the .NET JIT-compiled code cached? Where?](http://stackoverflow.com/questions/3295622/is-the-net-jit-compiled-code-cached-where) – Hans Passant Feb 15 '12 at 05:07
  • Are you sure there isn't simply something you run in the newer machine(s) that uses the CLR and effectively "preloads" it for you on boot or logon there? I know since ATI got bought up their Catalyst-branded software related to video adapters does this, and other vendors may be doing this now too. – Bob77 Feb 15 '12 at 05:41
  • Isn't that what splash screens are for :) – tcarvin Feb 15 '12 at 15:25
  • Yeah, but 20 second splash screens don't fly too well... – Jeff Feb 15 '12 at 16:17
  • How is this a duplicate? I'm not asking about where things are cached...I'm asking for suggestions to improve the problem... – Jeff Feb 15 '12 at 16:17

1 Answers1

2

I would try the following:

  • Crank out a .NET front end for your .NET code. See if it takes the same amount of time. If not (I doubt it), then the issue is with Interop.
  • Since the cross-over is done within the second, I'd profile the .NET code. Download a trial of Ants Profiler and see where the problem is.
  • Finally, throw on some ProcMon action to see what files are being accessed - that may give you a clue.

I do not thing GAC libraries take that long to load. I am guessing the code is doing a bit more reflection than you think.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594