my method to optimize application startup performance

G

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.

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
 
S

Stuart Redmann

George2 said:
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
 
T

Tomás Ó hÉilidhe

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.
 
V

Victor Bazarov

Tomás Ó hÉilidhe said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top