Application launch delay


#1

This is my first post so I will first express my compliments to Jules for what he has achieved and offered here. Truly amazing. Thank you very much.

We already use Juce here for shipping product GUIs, several of our programmers are familiar with it, but I am new to it. I want to develop a small MIDI utility and I was considering Java, but the size of the JSE install is a serious issue in deploying my little tool, so I am looking into Juce and I think it might just do the trick and then some…

Got 1.46. Compiled the Hello example on VC8, XP SP2 on a DELL. Works great. I built both the debug verion and the release version using the default project (amalgamated).

Here is the issue. If I double click on the debug exe from windows explorer it starts about as fast as you would expect (in a second or so). If you do the same with the release exe, first nothing seems to happen for about 5 seconds and then the window pops up.

I have tried a number of different ways of building the application (amalgamated or static_lib) with many combinations of compiler switches with no effect on that specific issue. I have all config defines set to 0 (tried many combinations there too). If I trick the release build into linking the debug lib, the problem goes away. So it seems to me that there is something in the API that makes the lib stall (timeout?) at launch if the /DEBUG switch is off. The delay is longest when launching the app the “frist” time. Subsequent restarts after closing seem to be snappier.

I couldn’t find a thread on this here. Does that ring a bell to anyone?
Thanks.


#2

it could be that a debug library (c runtime, etc) is already loaded by another application… I’m not sure if this would help, but using a utility like filemon (http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx), although now that I look it has been replaced by Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx)… in anycase, you can use this to trace what files are loaded by your application when it starts up…


#3

cpr, thanks for the suggestion. It helped me track down the condition.
In preparation for the logging on ProcMon, in order to avoid adding tons of filters to make it readable, I disabled all my tray applications and that alone made the problem go away! I finally closed in on the one application that is causing the issue. Windows Defender. Kill it in the tray after boot up and the release version of HelloWorld comes up as fast as the debug version.

In ProcMon I see MsMpEng.exe (Windows Defender) grab my exe file, do a bunch of randoms reeds on it and then close it about 5 seconds later, time which is consistent with the delay observed.

So I guess Defender is checking the exe for viruses, and it might not do so if the program was properly installed and registered as opposed to being ran from some random build folder.

I also ran a Procmon log on the debug version of the exe. MsMpEng.exe does the same scanning, but it closes the file immediately (not after 5 seconds) and it gets executed with no percievable delay.

What is there in the debug library that makes Windows Defender let go of the file faster than the same exe built with the release lib? Or does that even matter?