about summary refs log tree commit diff
path: root/benchtests/bench-skeleton.c
Commit message (Collapse)AuthorAgeFilesLines
* Use HP_TIMING for benchmarks if availableSiddhesh Poyarekar2013-05-131-21/+14
| | | | | | | | | | | | | HP_TIMING uses native timestamping instructions if available, thus greatly reducing the overhead of recording start and end times for function calls. For architectures that don't have HP_TIMING available, we fall back to the clock_gettime bits. One may also override this by invoking the benchmark as follows: make USE_CLOCK_GETTIME=1 bench and get the benchmark results using clock_gettime. One has to do `make bench-clean` to ensure that the benchmark programs are rebuilt.
* Fix coding styleSiddhesh Poyarekar2013-05-101-4/+4
|
* Preheat CPU in benchtests.Ondrej Bilka2013-05-081-0/+17
| | | | | | A benchmark could be skewed by CPU initialy working on minimal frequency and speeding up later. We first run code in loop to partialy fix this issue.
* Allow multiple input domains to be run in the same benchmark programSiddhesh Poyarekar2013-04-301-38/+41
| | | | | | | | | | | | | | | | | | | | | | | | Some math functions have distinct performance characteristics in specific domains of inputs, where some inputs return via a fast path while other inputs require multiple precision calculations, that too at different precision levels. The way to implement different domains was to have a separate source file and benchmark definition, resulting in separate programs. This clutters up the benchmark, so this change allows these domains to be consolidated into the same input file. To do this, the input file format is now enhanced to allow comments with a preceding # and directives with two # at the begining of a line. A directive that looks like: tells the benchmark generation script that what follows is a different domain of inputs. The value of the 'name' directive (in this case, foo) is used in the output. The two input domains are then executed sequentially and their results collated separately. with the above directive, there would be two lines in the result that look like: func(): .... func(foo): ...
* Maintain runtime of each benchmark at ~10 secondsSiddhesh Poyarekar2013-04-301-8/+30
| | | | | | | | | | | | | | | The idea to run benchmarks for a constant number of iterations is problematic. While the benchmarks may run for 10 seconds on x86_64, they could run for about 30 seconds on powerpc and worse, over 3 minutes on arm. Besides that, adding a new benchmark is cumbersome since one needs to find out the number of iterations needed for a sufficient runtime. A better idea would be to run each benchmark for a specific amount of time. This patch does just that. The run time defaults to 10 seconds and it is configurable at command line: make BENCH_DURATION=5 bench
* Framework for performance benchmarking of functionsSiddhesh Poyarekar2013-03-151-0/+75
See benchtests/Makefile to know how to use it.