algorithm benchmarking

February 04th, 2012 - 06:14 pm ET by SethP | Report spam
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
email Follow the discussionReplies 1 replyReplies Make a reply

Replies

#1 Jasen Betts
February 07th, 2012 - 06:11 am ET | Report spam
On 2012-02-04, SethP wrote:
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:


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'm impressed.

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.



another way would be to get the implementor to code the algorithm as a
shared library and use dlopen to plug it into the test suite, this gives
tighter control of the start state, and more room for verifying the
result...

⚂⚃ 100% natural

Posted via news://freenews.netfront.net/ - Complaints to

Similar topics