<ka****@gmail.com> wrote
I want to compare the performance of two algorithm. How do I do this on
linux. In matlab we have flops command for this purpose, is their any
such command or does any body have a script which would help me do so
in linux.
The question doesn't really have anything to do with linux.
When you compare two algorithms, there are many things you might want to
consider. Sometimes worst-case performace is the important thing, eg in an
animation where you don't want to drop a frame. Sometimes average
performance is more important, for instnace if you are running many
thousands of jobs in a batch. I can't think of a case where best
performance would be relevant.
Then you might be interested in the run time of the alorithm , or the
theoretical efficiency. For instance, your algorithm might need many disk
accesses on your particular machine, but run very quickly on a machine where
huge files are memory-mapped.
The thing to do is to analyse the algorithm, and then take metrics. If the
bottlneck is evaluating an exponential function, count how many times it is
called.
--
Visit my website
http://www.personal.leeds.ac.uk/~bgy1mm
Lots of programming goodies.