Link to home
Start Free TrialLog in
Avatar of bartteems
bartteemsFlag for United States of America

asked on

VB .Net application slow to startup

I have a VB .NET windows application that is slow to start up intermittently. My users are reporting that it can sometimes take up to 10-15 seconds. On startup, I have tried to minimize code to just show a form. No, splash screen, no database opens, etc. Couple of things that might be the cause.
1.      The installer  if I delete a file, say a Bitmap file, I notice that the file is recreated upon startup, so my installer must be checking the status of the application on startup. How can I make it stop doing this?
2.      I do use logging and log a program start message on startup
3.      I do use the application settings (am going to stop this because I find it unreliable any thoughts?)
4.      The form has a fair amount of controls, maybe 30, but not a huge amount.
5.      I do have one 32 bit Com object (Redemption) that gets loaded later, not a startup.
6.      I do have a web component (SharePoint list), but no action at startup
Any Ideas would be appreciated. Thanks.
Avatar of PlatoConsultant
PlatoConsultant
Flag of United States of America image

u need to use some testing tool or profiler which will tell u exactly what is slowing down ...
From MSDN Documentation

"A code profiler is a software tool, implemented as a DLL, which is
called by the runtime system during the execution of an image. The
profiler receives notifications each time a function is entered or
exited, as well as when other events occur that are of interest to the
programmer. By gathering statistics on these events, a profiler can
build a comprehensive picture of which routines used the most CPU
time, when garbage collections occurred, if exceptions were thrown,
and so on.

The runtime system connects a profiler to a process during process
initialization. To determine what to do, the runtime system checks two
environment variables: COR_ENABLE_PROFILING and COR_PROFILER.

If COR_ENABLE_PROFILING is absent or is set to the value 0, the
runtime system will not connect the process to the profiler.
Otherwise, the runtime system will connect the process to the profiler
whose specified class identifier (CLSID) is the value of COR_PROFILER.

For example, the command line causes the runtime system to create an
instance of the profiler COM class with this CLSID and connect it to
the process.

set Cor_Profiler={32E2F4DA-1BEA-47ea-88F9-C5DAF691C94A}
The profiler must implement the ICorProfilerCallback interface, which
the runtime system subsequently calls to apprise the profiler of
interesting events."
Avatar of bartteems

ASKER

Thank you PlatoConsultant. My issue is that the slowdown occurs on users machines, not mine, and it is intermittent, Sometimes it happens, sometimes not. The app is running on about 4,000 machines and I am getting complaints from about 400-500 of them. It does appear that the program is slower to start the first time after reboot, but then subsequent starts and stops are quicker. So my ability to debug via a profiler is limited.
ASKER CERTIFIED SOLUTION
Avatar of PlatoConsultant
PlatoConsultant
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry Complex Case, May be u should write Event Log, trace or log file... then u will get the required problem

may be CLR issues or Microsoft Bug ... or Operating system or Dot Net is missing some critical update...


Thank you for the assistance, I am exploring the profiler.