Ananth wrote:
> Satya Prasad <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>    In order to write efficient program, I was obsessed for better efficiency 
>> code. I understood that for the same we need to have better design and 
>> algorithms. And for measuring the algo efficiency I should calculate the 
>> time spend by system. I use the concept of printing time before and end of 
>> the algorithm execution.
>>
>>    Is my concept correct or there is some other efficient method of 
>> measuring an algorithm efficiency.
> 
> You are talking of two things: Efficient Code and Efficient Algo
> What you have done is profiling your function: measure time taken to
> execute your function.
> Typically you would do following for measuring your code optimization:
> (1) store time taken by function before you start optimization,
> (2) optimize your function,
> (3) profile how much time it takes after optimization.
> Subtract (3) and (1) is how much you've optimized your function\code.

Or use code profiling tools.  They tend to be more accurate anyway and 
many of them can pinpoint the exact line causing performance problems 
without having to manually modify the original code.  That is better 
than guessing as to where the problem lies.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to