my method to optimize application startup performance

Discussion in 'C++' started by George2, Nov 22, 2007.

  1. George2

    George2 Guest

    Hello everyone,


    I found that for an application, if I specify the entry point function
    (e.g. main), the performance of startup will be greatly improved.

    My questions are,

    1. If no entry point is specified, how will debugger of Visual Studio
    find the entry point function? Will the time to search entry point
    function long?

    For example, in my application, I defined the main function like this,

    int main(void)

    how will debugger treat main as the start point to execute (I set a
    break point to this function if I do not specify the entry point, then
    after a couple of minutes after pressing F5 to trigger debugger,
    debugger will jumps to main)?

    If I specify the entry point to main, then debugger will directly
    jumps to this function after F5 debugging.

    2. Specify entry point is a way to improve performance?


    thanks in advance,
    George
     
    George2, Nov 22, 2007
    #1
    1. Advertising

  2. George2 wrote:
    > Hello everyone,
    >
    >
    > I found that for an application, if I specify the entry point function
    > (e.g. main), the performance of startup will be greatly improved.
    >
    > My questions are,
    >
    > 1. If no entry point is specified, how will debugger of Visual Studio
    > find the entry point function? Will the time to search entry point
    > function long?


    This newsgroup is dedicated to the C++ programming language. Your question is
    about some particular compiler/debugger, so your are OT in two ways: Your
    question is not about the C++ language and it is platform specific. The guys at
    microsoft.public.vc.* will probably help you.

    [snip]

    Regards,
    Stuart
     
    Stuart Redmann, Nov 22, 2007
    #2
    1. Advertising

  3. George2:

    > Hello everyone,
    >
    >
    > I found that for an application, if I specify the entry point function
    > (e.g. main), the performance of startup will be greatly improved.



    Presumably because you're skipping a boat load of initialisation routines.


    > My questions are,
    >
    > 1. If no entry point is specified, how will debugger of Visual Studio
    > find the entry point function? Will the time to search entry point
    > function long?



    Is there a default? You should try asking on a Visual Studio group or
    forum.


    > For example, in my application, I defined the main function like this,
    >
    > int main(void)
    >
    > how will debugger treat main as the start point to execute (I set a
    > break point to this function if I do not specify the entry point, then
    > after a couple of minutes after pressing F5 to trigger debugger,
    > debugger will jumps to main)?
    >
    > If I specify the entry point to main, then debugger will directly jumps
    > to this function after F5 debugging.



    Haven't a clue, you'd have to ask Visual Studio folk.


    > 2. Specify entry point is a way to improve performance?



    Be careful which initialisation routines you're skipping! Your program
    might crash if you try to call a routine which should have been preceded
    by a call to an initialisation routine.

    --
    Tomás Ó hÉilidhe
     
    Tomás Ó hÉilidhe, Nov 26, 2007
    #3
  4. Tomás Ó hÉilidhe wrote:
    > George2:
    > [..]
    >> 2. Specify entry point is a way to improve performance?

    >
    >
    > Be careful which initialisation routines you're skipping! Your program
    > might crash if you try to call a routine which should have been
    > preceded by a call to an initialisation routine.


    [to George2:]

    ....especially if that initialisation routine is responsible for proper
    initialisation of some static objects, like 'std::cout' or 'std::cin'.
    Any use of those objects has undefined behaviour if they haven't been
    constructed correctly. OK, the library may know how to do the stuff
    it itself provides, but what if your program has some statics?...

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Nov 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Application Startup

    , Nov 15, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    1,883
    Jeff Dillon
    Nov 16, 2004
  2. mokles

    .Net application startup question

    mokles, Nov 28, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,093
    Michelle Hlaing
    Nov 29, 2004
  3. Replies:
    16
    Views:
    1,034
    Chris Uppal
    Apr 6, 2006
  4. news.internetia.pl
    Replies:
    2
    Views:
    562
    tricky
    Jan 12, 2008
  5. david.karr
    Replies:
    19
    Views:
    1,590
    Eric Sosman
    Sep 5, 2009
Loading...

Share This Page