Create instance takes long time???

  • Thread starter Thread starter serge calderara
  • Start date Start date
S

serge calderara

Dear all,

I have a simple class in my application whcih create
dynamically textbox control to be place on a form

When I execute the code :

log(time)
my control = new myclass()
log (time)
it take more than 3 secondes to execute, even if I have
just a simple line in myclass contructor.

I have notice that If I compile my project in release mode
it execute withinh 500ms but in debug mode more than 4
seconds.

Should I pay attention of this timimg in debug mode, I
mean how to dig out what is wrong ?

regards
serge
 
serge calderara said:
I have a simple class in my application whcih create
dynamically textbox control to be place on a form

When I execute the code :

log(time)
my control = new myclass()
log (time)
it take more than 3 secondes to execute, even if I have
just a simple line in myclass contructor.

I have notice that If I compile my project in release mode
it execute withinh 500ms but in debug mode more than 4
seconds.

Should I pay attention of this timimg in debug mode, I
mean how to dig out what is wrong ?

It's almost certainly just loading resources (which may be loaded by
the base classes of your control, not your control itself), JIT-
compiling code, etc.
 
Debug mode slows down execution - my experience. The rate of slowdown
depends on components in use in debugged application. E.g. my application
usually executes around 2 times slower when debugged. You can safely ignore
it.

If you are really concerned about execution time - use profiler and release
configuration.

HTH
Alex
 
Back
Top