algorithm benchmarking



Hi there,

I'd like to benchmark some algorithms and while I'm an experienced coder, linux internals is definitely not my area of expertise, so I have some questions:

1. Is there a solution I'm unaware of that already does this?
2. Assuming there isn't, what would be a good way to benchmark the algorithm with:
a) an accurate picture of the peak memory usage and utime
b) a simple interface for the algorithm to implement

My current idea is to have the benchmarking tool start the algorithm implementation as a child process, then get its /proc/PID/status mem info as a baseline, then send the child a signal to tell it to start, and then wait for the algorithm to send a signal indicating it's finished, then get its procinfo again and then kill it. So the algorithm implementation would need to adhere to the signaling spec and sleep when it's done and that's it.

Is this really dumb? I obviously have no idea what I'm talking about; I'd just like to measure as close to the algorithm as possible to get accurate benchmarks, without imposing a lot of complexity on the algorithm implementer.

Thanks for any help!
Seth
.



Relevant Pages

  • Re: Time this code, please!
    ... I'm talking about algorithm analysis. ... I was talking about algorithm complexity, not about counting cycles, as ... To have a consistent benchmark (that's why I said it was ... instructions will only have system processes affecting their results. ...
    (alt.lang.asm)
  • Re: Time this code, please!
    ... My question wasn't about the different x86 CPUs.. ... so you took an algorithm analysis class and you think that Big-Oh ... Uh, dude, the whole purpose of the benchmark was to measure the ...
    (alt.lang.asm)
  • Re: Organizing data for readability and efficiency
    ... same as choosing a good algorithm. ... benchmark to see where the bottleneckare. ... implementation in a lower level language for efficiency. ...
    (comp.lang.perl.misc)
  • Re: measuring clock cycles per second
    ... executes the algorithm and writes a report on the various timings ... cycle execution of the algorithm (to report the number lock cycles to ... compare that to the same benchmark on your hardware. ... clock cycles to complete. ...
    (comp.os.linux.development.apps)
  • Re: Announce: just::thread C++0x thread library beta 0.2
    ... against Terekhov's algorithm? ... LOCK BTS on ... I did benchmark it against the Terekhov algorithm whilst I was ... constructor to inline it as static initialization. ...
    (comp.programming.threads)