Feature #29
"timed_run" library function
| Status: | Closed | Start: | 07/08/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | - | |||
| Target version: | 3.2 | |||
Description
We have the same algorithm implemented in several places: for some tests we do benchmarking using a "dumb" wall clock timing, using time command.
A proposal is to make a "timed_run" library function that does the following:
- gets the target command (with full options, etc) to measure in $@
- runs this command under
time, redirects itsstdoutandstderrin$DEBUG_TTY - checks exit code — fails current test if there was an error
- gathers the data from
time - cuts wall clock from them and outputs it in
stdout - does proper garbage collecting (i.e. deletes temporary files, etc)
This way, most of encoding tests, for example, could be reduced to simple one call:
benchmark_submit_float \
'Encoding time' \
"`timed_run flac -$COMPRESSION_LEVEL -f -o /dev/null $SOURCE`" \
sec
History
Updated by Sergey Matveev 936 days ago
- Status changed from New to Closed
- % Done changed from 0 to 100