Re: comparing algorithm perf.
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Thu, 13 Mar 2008 11:28:45 +0100
Thierry MARTIN <thierry-martin@xxxxxxxxxxx> writes:
I would like to compare the perf of two algorithms written in C.
I feel that time-based method are not enough reliable (for instance
time (1) gives different results for the same program).
So, I would like to do a comparison based on the number of CPU
instructions required to process the same data in both cases.
profil (2) seems to be a good starting point, unfortunatly, I miss
some code sample to use it...
If sampling at 100Hz is sufficient that you actually get useful data,
you could simple compile a test program using -g -pg and run gprof on
the output. But you should probably have a look at OProfile
(http://oprofile.sourceforge.net) or some other 'high-resolution'
profiler instead (I have only used OProfile so far, but there are
others).
.
- References:
- comparing algorithm perf.
- From: Thierry MARTIN
- comparing algorithm perf.
- Prev by Date: Localization: default measurement units
- Next by Date: Re: comparing algorithm perf.
- Previous by thread: comparing algorithm perf.
- Next by thread: Re: comparing algorithm perf.
- Index(es):