my method to optimize application startup performance

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George2

    #1

    my method to optimize application startup performance

    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
  • Stuart Redmann

    #2
    Re: my method to optimize application startup performance

    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.publi c.vc.* will probably help you.

    [snip]

    Regards,
    Stuart

    Comment

    • =?iso-8859-1?b?VG9t4XMg0yBoyWlsaWRoZQ==?=

      #3
      Re: my method to optimize application startup performance

      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

      Comment

      • Victor Bazarov

        #4
        Re: my method to optimize application startup performance

        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


        Comment

        Working...