How to compare algorithms in linux

K

kabadi

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.
 
M

Malcolm

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top