I'm doing a program for video processing in which the time is very critical. I'm not having any difficulties in the program, but I would like to know from you, what things in coding takes most processing time? loops? if statements? goto statements ? functions? writing/reading text files ? other things? my program contains alot of each on of the above, and i would like to know which things take the most time so that I can try to minimize the time ( even 1 second matter in my application )
Asked
Active
Viewed 117 times
-5
-
2This is not the right way to figure out where performance issues will arise. Use a profiler instead. – P.Brian.Mackey Mar 05 '13 at 14:32
-
All of those take time. Get a good performance profiler, see what the slowest spots are, then tackle those. – D Stanley Mar 05 '13 at 14:33
-
You may find this interesting: http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html – TheNextman Mar 05 '13 at 14:35
2 Answers
3
It is impossible to give a precise answer using the data above. It most likely will be in some library calls to the video processing library, but this is just guesswork.
The only sensible answer is therefore: Use a profiler to find out where exactly your program spents it's time.
A profiler is a program that analyzes your program and determines where it spends its time.

Wilbert
- 7,251
- 6
- 51
- 91
-
The redgate profiler is easy to use and has a 30 day trial. Link: http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ – Th 00 mÄ s Mar 05 '13 at 14:36
-
would you tell me what a profiler is ? if you would provide me with some usefull links, it is really my first time to hear about that – Mahmood Shahin Mar 05 '13 at 14:37
-
Another good indicator of potential performance bottleneck are subroutines with high growth rates. Look into [Big O Notation](http://stackoverflow.com/questions/487258/plain-english-explanation-of-big-o). – Dustin Kingen Mar 05 '13 at 14:43
0
I agree about using the profiler. In some cases using the profiler might slow the program too much or take too much memory. in such cases an informed use of time measurment using: StopWatch
might do the trick.

omer schleifer
- 3,897
- 5
- 31
- 42