Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have made some slight changes to the software I'm developing and now it's performing extremely slow on other computers (it works fast on my computer because it has a very powerful quad core processor). I tried stepping through the code but I can't find out what's causing the slow problem. I even reviewed and simplified some methods but still there's no improvement on other computers.
I observed the software when other people use it and I got the impression that the data is actually loading faster but the form it self updates very slowly. Is there anyway to track what's causing the software to run slow?
Posted

Please have a look at my answer to a similar question here on CP: how high Speed Application?[^]. You want to use such a profiling tool in order to find out where the bottlenecks in your application are occurring.

Happy coding and profiling!

-MRB
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-May-11 20:55pm    
Hope you recommend good tools, my 5. Good to know.

I put general recommendations plus home-backed timing with occasionally can be useful as well.
Please see.
--SA
First, there is a class of development tools called Profilers. A good Profiler runs a software product under control and helps to find out performance bottlenecks very rapidly. The developer uses this information to improve performance of small fraction of performance critical code and runs it under the Profiler again.

You can try to perform your search to find appropriate Profiler. At this moment, I cannot give certain recommendations for a good .NET Profiler.

If you need to measure performance of the fragments of code only occasionally, you can create a simple home-baked ad-hoc "Profiler" using the class System.Diagnostics.Stopwatch:

C#
System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch();

//..

stopWatch.Start();
//some code to time
stopWatch.Stop();

System.TimeSpan duration = stopWatch.Elapsed;

//don't use Millisecond which will be rounded to integer value;
//use TotalMilliseconds or TotalSeconds and the like:
double elapsedTimeMs = duration.TotalMilliseconds;


The class Stopwatch has much better accuracy compared to timer classes or System.DateTime class; this is the best class to measure performance.

—SA
 
Share this answer
 
Comments
Manfred Rudolf Bihy 23-May-11 21:09pm    
Stopwatch is also a way to go! 5+
It's harder though as you have to sprinkle your code liberally with the nescessary measurement points. Of course you can also use AOP to alleviate that problem.
Sergey Alexandrovich Kryukov 23-May-11 22:56pm    
Thank you, Manfred.
You're perfectly right here, good notes.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900