Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long execution time

Status
Not open for further replies.

ctopmep

IS-IT--Management
Feb 2, 2004
12
GB
I have written a small c# program that connects to a sql server, displays some information and gives the user an option for logging out.
The executable is located in the desktop folder of users having mandatory user profile on Windows XP Professional.
The problem is that it takes very long time to execute the program. After first execution, the second is faster and the third is even faster, but after restart and sometimes after logoff/logon execution is slow again.
How can I check what causes such long time to start the program?
If the program is executed once, JIT compilation occurs, but is copying the file on another machine causing executable to be recompiled? If the file is in the desktop of mandatory profile, does it mean that recompilation will occur every time user logs on?
Anybody with an idea?
 
If the executable is being loaded over the network, aside from the obvious network communication delays, the .net runtime has to perform extensive security checks on it to make sure it's safe to run. This will involve communicating to the active directory controller, which involves a DNS lookup. I would start looking at your network configuration and work your way up the stack.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The program is only 20-30 KB, but I found that when started it takes about 20MB of RAM. I am watching in processes from task manager and it starts after taking 20MB of RAM and after extensive hard disk working (I am speaking for locally started application, not from network).
I compiled an empty form from visual studio 2005. After staring, it takes about 8MB of RAM. Am I doing something wrong, or it is normal for .NET applications to be so resource hungry?
 
I am not sure if it uses that much memory, but in task manager, until memory usage reaches 20MB (takes 10-15 secs), the program won't start, and for such small program it is a bit too long.
 
Did you notice Chip's post above? If you're running over a network there is a lot of underlying connection safetly checks being performed. This takes time. Consider looking into worker threads to make the application respond a little bit faster. You data retrieval will still be slow though.
 
20mb is normal for a .net program. Your 2nd .net program (depending on security checks) will probably make use of a lot of the shared assemblies and have a much smaller overall footprint.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top