diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-06-04 15:48:26 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-06-04 15:48:26 +0000 |
commit | 8548b3be8c48bf62bd4e20fb0ee958338b01bc6c (patch) | |
tree | 874deff152fded2f5b50110ee6d488d42605bb01 /libc/benchtests | |
parent | eab7f6089510455a9b26643c64da331749a15650 (diff) | |
download | eglibc2-8548b3be8c48bf62bd4e20fb0ee958338b01bc6c.tar.gz |
Merge changes between r23097 and r23217 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@23218 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/benchtests')
-rw-r--r-- | libc/benchtests/Makefile | 60 | ||||
-rw-r--r-- | libc/benchtests/README | 74 | ||||
-rw-r--r-- | libc/benchtests/acos-inputs | 7 | ||||
-rw-r--r-- | libc/benchtests/acosh-inputs | 5 | ||||
-rw-r--r-- | libc/benchtests/asin-inputs | 7 | ||||
-rw-r--r-- | libc/benchtests/asinh-inputs | 5 | ||||
-rw-r--r-- | libc/benchtests/atanh-inputs | 5 | ||||
-rw-r--r-- | libc/benchtests/cosh-inputs | 5 | ||||
-rw-r--r-- | libc/benchtests/log-inputs | 1 | ||||
-rw-r--r-- | libc/benchtests/sinh-inputs | 5 | ||||
-rw-r--r-- | libc/benchtests/tanh-inputs | 5 |
11 files changed, 158 insertions, 21 deletions
diff --git a/libc/benchtests/Makefile b/libc/benchtests/Makefile index 861839013..67728537a 100644 --- a/libc/benchtests/Makefile +++ b/libc/benchtests/Makefile @@ -17,34 +17,52 @@ # Makefile for benchmark tests. The only useful target here is `bench`. +# Add benchmark functions in alphabetical order. -# Adding a new function `foo`: -# --------------------------- +subdir := benchtests +bench := acos acosh asin asinh atan atanh cos cosh exp log modf pow rint sin \ + sinh tan tanh -# - Append the function name to the bench variable +acos-ARGLIST = double +acos-RET = double +LDFLAGS-bench-acos = -lm -# - Define foo-ARGLIST as a colon separated list of types of the input -# arguments. Use `void` if function does not take any inputs. Put in quotes -# if the input argument is a pointer, e.g.: +acosh-ARGLIST = double +acosh-RET = double +LDFLAGS-bench-acosh = -lm -# malloc-ARGLIST: "void *" +asin-ARGLIST = double +asin-RET = double +LDFLAGS-bench-asin = -lm -# - Define foo-RET as the type the function returns. Skip if the function -# returns void. One could even skip foo-ARGLIST if the function does not -# take any inputs AND the function returns void. +asinh-ARGLIST = double +asinh-RET = double +LDFLAGS-bench-asinh = -lm +atan-ARGLIST = double +atan-RET = double +LDFLAGS-bench-atan = -lm -# - Make a file called `foo-inputs` with one input value per line, an input -# being a comma separated list of arguments to be passed into the function. -# See pow-inputs for an example. +atanh-ARGLIST = double +atanh-RET = double +LDFLAGS-bench-atanh = -lm -subdir := benchtests -bench := exp pow rint sin cos tan atan modf +cos-ARGLIST = double +cos-RET = double +LDFLAGS-bench-cos = -lm + +cosh-ARGLIST = double +cosh-RET = double +LDFLAGS-bench-cosh = -lm exp-ARGLIST = double exp-RET = double LDFLAGS-bench-exp = -lm +log-ARGLIST = double +log-RET = double +LDFLAGS-bench-log = -lm + pow-ARGLIST = double:double pow-RET = double LDFLAGS-bench-pow = -lm @@ -57,17 +75,17 @@ sin-ARGLIST = double sin-RET = double LDFLAGS-bench-sin = -lm -cos-ARGLIST = double -cos-RET = double -LDFLAGS-bench-cos = -lm +sinh-ARGLIST = double +sinh-RET = double +LDFLAGS-bench-sinh = -lm tan-ARGLIST = double tan-RET = double LDFLAGS-bench-tan = -lm -atan-ARGLIST = double -atan-RET = double -LDFLAGS-bench-atan = -lm +tanh-ARGLIST = double +tanh-RET = double +LDFLAGS-bench-tanh = -lm diff --git a/libc/benchtests/README b/libc/benchtests/README new file mode 100644 index 000000000..8135069fe --- /dev/null +++ b/libc/benchtests/README @@ -0,0 +1,74 @@ +Using the glibc microbenchmark suite +==================================== + +The glibc microbenchmark suite automatically generates code for specified +functions, builds and calls them repeatedly for given inputs to give some +basic performance properties of the function. + +Running the benchmark: +===================== + +The benchmark can be executed by invoking make as follows: + + $ make bench + +This runs each function for 10 seconds and appends its output to +benchtests/bench.out. To ensure that the tests are rebuilt, one could run: + + $ make bench-clean + +The duration of each test can be configured setting the BENCH_DURATION variable +in the call to make. One should run `make bench-clean' before changing +BENCH_DURATION. + + $ make BENCH_DURATION=1 bench + +The benchmark suite does function call measurements using architecture-specific +high precision timing instructions whenever available. When such support is +not available, it uses clock_gettime (CLOCK_PROCESS_CPUTIME_ID). One can force +the benchmark to use clock_gettime by invoking make as follows: + + $ make USE_CLOCK_GETTIME=1 bench + +Again, one must run `make bench-clean' before changing the measurement method. + +Adding a function to benchtests: +=============================== + +If the name of the function is `foo', then the following procedure should allow +one to add `foo' to the bench tests: + +- Append the function name to the bench variable in the Makefile. + +- Define foo-ARGLIST as a colon separated list of types of the input + arguments. Use `void' if function does not take any inputs. Put in quotes + if the input argument is a pointer, e.g.: + + malloc-ARGLIST: "void *" + +- Define foo-RET as the type the function returns. Skip if the function + returns void. One could even skip foo-ARGLIST if the function does not + take any inputs AND the function returns void. + +- Make a file called `foo-inputs` with one input value per line, an input + being a comma separated list of arguments to be passed into the function. + See pow-inputs for an example. + + The script that parses the -inputs file treats lines beginning with a single + `#' as comments. Lines beginning with two hashes `##' are treated specially + as `directives'. + +Multiple execution units per function: +===================================== + +Some functions have distinct performance characteristics for different input +domains and it may be necessary to measure those separately. For example, some +math functions perform computations at different levels of precision (64-bit vs +240-bit vs 768-bit) and mixing them does not give a very useful picture of the +performance of these functions. One could separate inputs for these domains in +the same file by using the `name' directive that looks something like this: + + ##name: 240bit + +See the pow-inputs file for an example of what such a partitioned input file +would look like. diff --git a/libc/benchtests/acos-inputs b/libc/benchtests/acos-inputs new file mode 100644 index 000000000..b527af35e --- /dev/null +++ b/libc/benchtests/acos-inputs @@ -0,0 +1,7 @@ +0.5 +0.1 +0.2 +0.3 +0.4 +0.8 +0.7 diff --git a/libc/benchtests/acosh-inputs b/libc/benchtests/acosh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/acosh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 diff --git a/libc/benchtests/asin-inputs b/libc/benchtests/asin-inputs new file mode 100644 index 000000000..b527af35e --- /dev/null +++ b/libc/benchtests/asin-inputs @@ -0,0 +1,7 @@ +0.5 +0.1 +0.2 +0.3 +0.4 +0.8 +0.7 diff --git a/libc/benchtests/asinh-inputs b/libc/benchtests/asinh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/asinh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 diff --git a/libc/benchtests/atanh-inputs b/libc/benchtests/atanh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/atanh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 diff --git a/libc/benchtests/cosh-inputs b/libc/benchtests/cosh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/cosh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 diff --git a/libc/benchtests/log-inputs b/libc/benchtests/log-inputs new file mode 100644 index 000000000..713c2229f --- /dev/null +++ b/libc/benchtests/log-inputs @@ -0,0 +1 @@ +42.0 diff --git a/libc/benchtests/sinh-inputs b/libc/benchtests/sinh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/sinh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 diff --git a/libc/benchtests/tanh-inputs b/libc/benchtests/tanh-inputs new file mode 100644 index 000000000..3c8c546f0 --- /dev/null +++ b/libc/benchtests/tanh-inputs @@ -0,0 +1,5 @@ +0.1 +0.2 +0.3 +0.4 +0.5 |