about summary refs log tree commit diff
path: root/benchtests
Commit message (Collapse)AuthorAgeFilesLines
* Make strtok benchmark competive.Ondřej Bílka2014-02-281-57/+4
| | | | | We include a generic version of strtok to result which could be faster when underlying primitives are better optimized than current version.
* Consistently include Makeconfig after defining subdir.Joseph Myers2014-02-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In <https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html> I noted it was necessary to add includes of Makeconfig early in various subdirectory makefiles for the tests-special variable settings added by that patch to be conditional on configuration information. No-one commented on the general question there of whether Makeconfig should always be included immediately after the definition of subdir. This patch implements that early inclusion of Makeconfig in each directory (which is a lot easier than consistent placement of includes of Rules). Includes are added if needed, or moved up if already present. Subdirectory "all:" targets are removed, since Makeconfig provides one. There is potential for further cleanups I haven't done. Rules and Makerules have code such as ifneq "$(findstring env,$(origin headers))" "" headers := endif to override to empty any value of various variables that came from the environment. I think there is a case for Makeconfig setting all the subdirectory variables (other than subdir) to empty to ensure no outside value is going to take effect if a subdirectory fails to define a variable. (A list of such variables, possibly out of date and incomplete, is in manual/maint.texi.) Rules and Makerules would give errors if Makeconfig hadn't already been included, instead of including it themselves. The special code to override values coming from the environment would then be obsolete and could be removed. Tested x86_64, including that installed binaries are identical before and after the patch. * argp/Makefile: Include Makeconfig immediately after defining subdir. * assert/Makefile: Likewise. * benchtests/Makefile: Likewise. * catgets/Makefile: Likewise. * conform/Makefile: Likewise. * crypt/Makefile: Likewise. * csu/Makefile: Likewise. (all): Remove target. * ctype/Makefile: Include Makeconfig immediately after defining subdir. * debug/Makefile: Likewise. * dirent/Makefile: Likewise. * dlfcn/Makefile: Likewise. * gmon/Makefile: Likewise. * gnulib/Makefile: Likewise. * grp/Makefile: Likewise. * gshadow/Makefile: Likewise. * hesiod/Makefile: Likewise. * hurd/Makefile: Likewise. (all): Remove target. * iconvdata/Makefile: Include Makeconfig immediately after defining subdir. * inet/Makefile: Likewise. * intl/Makefile: Likewise. * io/Makefile: Likewise. * libio/Makefile: Likewise. (all): Remove target. * locale/Makefile: Include Makeconfig immediately after defining subdir. * login/Makefile: Likewise. * mach/Makefile: Likewise. (all): Remove target. * malloc/Makefile: Include Makeconfig immediately after defining subdir. (all): Remove target. * manual/Makefile: Include Makeconfig immediately after defining subdir. * math/Makefile: Likewise. * misc/Makefile: Likewise. * nis/Makefile: Likewise. * nss/Makefile: Likewise. * po/Makefile: Likewise. (all): Remove target. * posix/Makefile: Include Makeconfig immediately after defining subdir. * pwd/Makefile: Likewise. * resolv/Makefile: Likewise. * resource/Makefile: Likewise. * rt/Makefile: Likewise. * setjmp/Makefile: Likewise. * shadow/Makefile: Likewise. * signal/Makefile: Likewise. * socket/Makefile: Likewise. * soft-fp/Makefile: Likewise. * stdio-common/Makefile: Likewise. * stdlib/Makefile: Likewise. * streams/Makefile: Likewise. * string/Makefile: Likewise. * sunrpc/Makefile: Likewise. (all): Remove target. * sysvipc/Makefile: Include Makeconfig immediately after defining subdir. * termios/Makefile: Likewise. * time/Makefile: Likewise. * timezone/Makefile: Likewise. (all): Remove target. * wcsmbs/Makefile: Include Makeconfig immediately after defining subdir. * wctype/Makefile: Likewise. libidn/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. localedata/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. (all): Remove target. nptl/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. nptl_db/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir.
* Minor formatting fixSiddhesh Poyarekar2014-02-211-2/+2
|
* print length in strrchr benchtestRajalakshmi Srinivasaraghavan2014-02-211-1/+1
| | | | | The return criteria of strrchr() is to read till NULL even if the search character is hit. So its better to print len instead of pos.
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-1/+1
|
* tests: unify fortification handler logicMike Frysinger2014-02-081-20/+5
| | | | | | | We have multiple tests that copy & paste the same logic for disabling the fortification output. Let's unify this in the test-skeleton instead. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Correct inputs for sin and cosSiddhesh Poyarekar2014-01-102-29/+6
| | | | | The inputs for the slowest path in asin and acos were incorrect and had some fast path inputs there too.
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-0142-42/+42
|
* Benchmark inputs for cos and sinSiddhesh Poyarekar2013-12-312-12/+5300
| | | | | | Add a comprehensive number of inputs for all branches in sin and cos computation, excluding the fast paths. This also adds a number of inputs for the multiple precision slow paths.
* benchmark inputs for atanSiddhesh Poyarekar2013-12-311-5/+802
| | | | | | | Add a more comprehensive set of inputs for the atan function. I have also fixed the name on the multiple precision fallback inputs (I couldn't find any new inputs there) to reflect the fact that the fallback is only 144bits and not 768bits as I had earlier mentioned.
* benchmark inputs for tanh and atanhSiddhesh Poyarekar2013-12-312-10/+400
|
* benchmark inputs for asinh and acoshSiddhesh Poyarekar2013-12-312-10/+600
| | | | | | Like sinh and cosh, this patch has benchmark inputs for asinh and acosh, generated using a random number generator and spread over significant branches, ignoring the fast return paths.
* benchmark inputs for sinh and coshSiddhesh Poyarekar2013-12-312-10/+700
| | | | | | | Add a full set of inputs for sinh and cosh functions generated using a random number generator and spreading it over all branches in the function, ignoring the fast paths (i.e. immediate return for special values).
* benchmark inputs for asin and acosSiddhesh Poyarekar2013-12-312-14/+5240
| | | | | Add a comprehensive set of inputs for asin and acos functions, including the multiple precision fallback path.
* benchtests: Add strtok benchmarkRajalakshmi Srinivasaraghavan2013-12-192-1/+206
|
* benchmark inputs for exp2, log2, log and tanSiddhesh Poyarekar2013-12-125-4/+4053
|
* Accept output arguments to benchmark functionsSiddhesh Poyarekar2013-12-053-87/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to accept output arguments to functions being benchmarked, by nesting the argument type in <> in the args directive. It includes the sincos implementation as an example, where the function would have the following args directive: ## args: double:<double *>:<double *> This simply adds a definition for a static variable whose pointer gets passed into the function, so it's not yet possible to pass something more complicated like a pre-allocated string or array. That would be a good feature to add if a function needs it. The values in the input file will map only to the input arguments. So if I had a directive like this for a function foo: ## args: int:<int *>:int:<int *> and I have a value list like this: 1, 2 3, 4 5, 6 then the function calls generated would be: foo (1, &out1, 2, &out2); foo (3, &out1, 4, &out2); foo (5, &out1, 6, &out2);
* Benchmark test for sqrt function.Steve Ellcey2013-12-022-1/+12
|
* Also remove benchtests/bench-strsep-ifunc.cOndřej Bílka2013-11-261-20/+0
|
* Remove duplicate ifunc benchtests.Ondřej Bílka2013-11-2636-682/+2
|
* benchtests: Add strsep benchmarkRajalakshmi Srinivasaraghavan2013-11-183-1/+195
|
* 2013-11-13 Steve Ellcey <sellcey@mips.com>Steve Ellcey2013-11-131-0/+2
| | | | * benchtests/bench-timing.h: Include time.h.
* benchtests: Add strtod benchmarkAdhemerval Zanella2013-11-112-1/+120
|
* Benchmark inputs for powSiddhesh Poyarekar2013-10-281-0/+503
| | | | | These inputs cover all normal processing paths for pow including all its slow paths.
* New inputs for expSiddhesh Poyarekar2013-10-281-0/+581
| | | | | | A more comprehensive set of inputs for exp, including all slow paths. The inputs have been shuffled so that they don't give a false-positive due to a hot cache.
* benchtests: Add include-sources directive.Torvald Riegel2013-10-101-2/+5
| | | | | | This adds the "include-sources" directive to scripts/bench.pl. This allows for including source code (vs including headers, which might get a different search path) after the inclusion of any headers.
* Add more directives to benchmark input filesSiddhesh Poyarekar2013-10-0718-67/+67
| | | | | | | | | | | | | | | | | | | | | | This patch adds some more directives to the benchmark inputs file, moving functionality from the Makefile and making the code generation script a bit cleaner. The function argument and return types that were earlier added as variables in the makefile and passed to the script via command line arguments are now the 'args' and 'ret' directive respectively. 'args' should be a colon separated list of argument types (skipped if the function doesn't accept any arguments) and 'ret' should be the return type. Additionally, an 'includes' directive may have a comma separated list of headers to include in the source. For example, the pow input file now looks like this: 42.0, 42.0 1.0000000000000020, 1.5 I did this to unclutter the benchtests Makefile a bit and eventually eliminate dependency of the tests on the Makefile and have tests depend on their respective include files only.
* Add benchmark inputs for sincosSiddhesh Poyarekar2013-09-192-1/+89
|
* benchtests: Rename argument to TIMING_INIT macro.Will Newton2013-09-112-10/+10
| | | | | | | | | | | | | | | | The TIMING_INIT macro currently sets the number of loop iterations to 1000, which limits usefulness. Make the argument a clock resolution value and multiply by 1000 in bench-skeleton.c instead to allow easier reuse. ChangeLog: 2013-09-11 Will Newton <will.newton@linaro.org> * benchtests/bench-timing.h (TIMING_INIT): Rename ITERS parameter to RES. Remove hardcoded 1000 value. * benchtests/bench-skeleton.c (main): Pass RES parameter to TIMING_INIT and multiply result by 1000.
* benchtests: Add memrchr benchmarkAdhemerval Zanella2013-09-064-4/+66
|
* benchtests/Makefile: Run benchmark for memcpy.Will Newton2013-09-061-5/+5
| | | | | | | | | | The benchmark for memcpy got disabled accidentally. Re-enable it. ChangeLog: 2013-09-06 Will Newton <will.newton@linaro.org> * benchtests/Makefile (string-bench): Add memcpy.
* benchtests: Switch string benchmarks to use bench-timing.h.Will Newton2013-09-0427-502/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the string benchmarks to using bench-timing.h instead of hp-timing.h directly. This allows the string benchmarks to be run usefully on architectures such as ARM that do not have support for hp-timing.h. In order to do this the tests have been changed from timing each individual call and picking the lowest execution time recorded to timing a number of calls and taking the mean execution time. ChangeLog: 2013-09-04 Will Newton <will.newton@linaro.org> * benchtests/bench-timing.h (TIMING_PRINT_MEAN): New macro. * benchtests/bench-string.h: Include bench-timing.h instead of including hp-timing.h directly. (INNER_LOOP_ITERS): New define. (HP_TIMING_BEST): Delete macro. (test_init): Remove call to HP_TIMING_DIFF_INIT. * benchtests/bench-memccpy.c: Use bench-timing.h macros instead of hp-timing.h macros. * benchtests/bench-memchr.c: Likewise. * benchtests/bench-memcmp.c: Likewise. * benchtests/bench-memcpy.c: Likewise. * benchtests/bench-memmem.c: Likewise. * benchtests/bench-memmove.c: Likewise. * benchtests/bench-memset.c: Likewise. * benchtests/bench-rawmemchr.c: Likewise. * benchtests/bench-strcasecmp.c: Likewise. * benchtests/bench-strcasestr.c: Likewise. * benchtests/bench-strcat.c: Likewise. * benchtests/bench-strchr.c: Likewise. * benchtests/bench-strcmp.c: Likewise. * benchtests/bench-strcpy.c: Likewise. * benchtests/bench-strcpy_chk.c: Likewise. * benchtests/bench-strlen.c: Likewise. * benchtests/bench-strncasecmp.c: Likewise. * benchtests/bench-strncat.c: Likewise. * benchtests/bench-strncmp.c: Likewise. * benchtests/bench-strncpy.c: Likewise. * benchtests/bench-strnlen.c: Likewise. * benchtests/bench-strpbrk.c: Likewise. * benchtests/bench-strrchr.c: Likewise. * benchtests/bench-strspn.c: Likewise. * benchtests/bench-strstr.c: Likewise.
* benchtests/Makefile: Use LDLIBS instead of LDFLAGS.Will Newton2013-09-041-16/+16
| | | | | | | | | | | LDFLAGS puts the library too early in the command line if --as-needed is being used. Use LDLIBS instead. ChangeLog: 2013-09-04 Will Newton <will.newton@linaro.org> * benchtests/Makefile: Use LDLIBS instead of LDFLAGS.
* Fix loop construction to functions callsAdhemerval Zanella2013-06-202-0/+2
| | | | | | Check wheter the compiler has the option -fno-tree-loop-distribute-patterns to inhibit loop transformation to library calls and uses it on memset and memmove default implementation to avoid recursive calls.
* Port remaining string benchmarksSiddhesh Poyarekar2013-06-115-1/+349
| | | | | There were a few more string benchmarks (strcpy_chk and stpcpy_check) in the debug directory that needed to be ported over.
* Copy over string performance tests into benchtestsSiddhesh Poyarekar2013-06-1161-1/+4991
| | | | | Copy over already existing string performance tests into benchtests. Bits not related to performance measurements have been omitted.
* Begin porting string performance tests to benchtestsSiddhesh Poyarekar2013-06-115-3/+434
| | | | | | | | | | | | | | This is the initial support for string function performance tests, along with copying tests for memcpy and memcpy-ifunc as proof of concept. The string function benchmarks perform operations at different alignments and for different sizes and compare performance between plain operations and the optimized string operations. Due to this their output is incompatible with the function benchmarks where we're interested in fastest time, throughput, etc. In future, the correctness checks in the benchmark tests can be removed. Same goes for the performance measurements in the string/test-*.
* Avoid overwriting earlier flags in CPPFLAGS-nonlib in benchtestsSiddhesh Poyarekar2013-06-101-1/+1
| | | | | | When setting BENCH_DURATION in CPPFLAGS-nonlib, append to the variable instead of assigning to it, to avoid overwriting earlier set flags, notably the -DNOT_IN_libc=1 flag.
* Sort benchmark functionsSiddhesh Poyarekar2013-05-221-41/+42
|
* Add benchmark inputs for math functionsSiddhesh Poyarekar2013-05-2210-1/+83
| | | | | Add benchmark inputs for inverse and hyperbolic trigonometric functions and log.
* Add a README for benchtestsSiddhesh Poyarekar2013-05-212-20/+74
| | | | Move instructions from the Makefile here and expand on them.
* Prevent optimizing out of benchmark function callSiddhesh Poyarekar2013-05-171-1/+1
| | | | | | | | | | Resolves: #15424 The compiler would optimize the benchmark function call out of the loop and call it only once, resulting in blazingly fast times for some benchmarks (notably atan, sin and cos). Mark the inputs as volatile so that the code is forced to read again from the input for each iteration.
* Use HP_TIMING for benchmarks if availableSiddhesh Poyarekar2013-05-133-22/+93
| | | | | | | | | | | | | 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-3021-217/+87
| | | | | | | | | | | | | | | | | | | | | | | | 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-303-29/+38
| | | | | | | | | | | | | | | 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
* Mention files in which fast/slow paths of math functions are implementedSiddhesh Poyarekar2013-04-241-12/+12
|
* PowerPC: modf optimizationAdhemerval Zanella2013-04-232-1/+40
| | | | | This patch implements modf/modff optimization for POWER by focus on FP operations instead of relying in integer ones.
* Add benchmark inputs for cos and tanSiddhesh Poyarekar2013-04-177-1/+78
|