Time gap between process initialization and call to InitInstance RRS feed

  • Question

  • Hi there,

    I'm currently trying to speed up the initialization time of my CE device. First of all I took some measurements on various parts of the system.

    Let me give you an short overview on what is happening on startup. I'm launching a small application with the init mechanism based in the registry (HKLM\init). This application does some initialisation and then starts the main application (using CreateProcess). Our main application is MFC based. It's been growing over years, so actually it's about 6 MB of size.

    My measurements showed a gap right between the call to CreateProcess on the one hand and the call to InitInstance on the other hand (about 900 ms). I found out that all the global variable are being initialized before InitInstance is being call. I also found out, that external dll are also being initialized before that. I therefore did some changes in order to avoid waste of time. Currently it takes about 400 ms until InitInstance is being called.

    Is there a possibility to get information on what is being done in between? Or, let me rephrase my question, what else could take influence on this gap?

    I also did some tests with changing the stack (commit / reserve) size in the linker options. This also took effect. By decreasing size the gap was getting bigger.

    Any help would be appreciated.

    Thanks in advance,

    Friday, May 20, 2011 8:39 AM