aboutsummaryrefslogtreecommitdiff
path: root/benchtests
AgeCommit message (Collapse)AuthorFilesLines
2014-04-15benchtests: Link against objects in build directorySiddhesh Poyarekar1-23/+9
Using -lm and -lpthread results in the shared objects in the system being used to link against. This happened to work for libm because there haven't been any changes to the libm ABI recently that could break the existing benchmarks. This doesn't always work for the pthread benchmarks. The correct way to build against libraries in the build directory is to have the binaries explicitly depend on them so that $(+link) can pick them up.
2014-04-11benchtests: Improve readability of JSON outputWill Newton5-23/+256
Add a small library to print JSON values and use it to improve the readability of the benchmark output and the readability of the benchmark code. ChangeLog: 2014-04-11 Will Newton <will.newton@linaro.org> * benchtests/Makefile (extra-objs): Add json-lib.o. (bench-func): Tidy up JSON output. * benchtests/bench-skeleton.c: Include json-lib.h. (main): Use JSON library functions to do output of benchmark results. * benchtests/bench-timing-type.c (main): Output the timing type simply, leaving formatting to the user. * benchtests/json-lib.c: New file. * benchtests/json-lib.h: Likewise.
2014-04-10benchtests: Add pthread_once common-case test.Torvald Riegel4-1/+38
We have a single thread that runs a no-op initialization once and then repeatedly runs checks of the initialization (i.e., an acquire load and conditional jump) in a tight loop. This gives us, on average, the best-case latency of pthread_once (the initialization is the exactly-once slow path, and we're not looking at initialization-related synchronization overheads in this case).
2014-04-01benchtests: Build ffs and ffsl benchtests with -fno-builtinWill Newton1-0/+3
Without this flag it is possible that the compiler will optimize away the calls to ffs/ffsll. ChangeLog: 2014-04-01 Will Newton <will.newton@linaro.org> * benchtests/Makefile (CFLAGS-bench-ffs.c): Add -fno-builtin. (CFLAGS-bench-ffsll.c): Likewise.
2014-03-31benchtests: Add benchtests for ffs and ffsllWill Newton3-3/+208
Add benchtests for ffs and ffsll. There is no benchtest for ffsl as it is identical to one of the other functions. 2014-03-31 Will Newton <will.newton@linaro.org> * benchtests/Makefile (bench): Add ffs and ffsll to list of tests. * benchtests/ffs-inputs: New file. * benchtests/ffsll-inputs: Likewise.
2014-03-29Detailed benchmark outputs for functionsSiddhesh Poyarekar3-2/+34
This patch adds an option to get detailed benchmark output for functions. Invoking the benchmark with 'make DETAILED=1 bench' causes each benchmark program to store a mean execution time for each input it works on. This is useful to give a more comprehensive picture of performance of functions compared to just the single mean figure.
2014-03-29Make bench.out in json formatSiddhesh Poyarekar5-18/+66
This patch changes the output format of the main benchmark output file (bench.out) to an extensible format. I chose JSON over XML because in addition to being extensible, it is also not too verbose. Additionally it has good support in python. The significant change I have made in terms of functionality is to put timing information as an attribute in JSON instead of a string and to do that, there is a separate program that prints out a JSON snippet mentioning the type of timing (hp_timing or clock_gettime). The mean timing has now changed from iterations per unit to actual timing per iteration.
2014-03-29[benchtests] Use inputs file for modfSiddhesh Poyarekar2-44/+4
The modf benchmark can now use the framework since the introduction of output arguments.
2014-03-26benchtests/bench-strtod.c: Increase timeout valueWill Newton1-0/+3
This benchmark can take longer than the default 2 seconds on slower platforms, so increase it to 10 seconds. ChangeLog: 2014-03-26 Will Newton <will.newton@linaro.org> * benchtests/bench-strtod.c (TIMEOUT): Define to 10.
2014-03-24benchtests: Move bench.py to benchtests/scripts/Siddhesh Poyarekar2-1/+300
It makes much more sense to have all benchmarking-related scripts in a single place away from everything else.
2014-03-21Implement benchmarking script in pythonSiddhesh Poyarekar2-2/+4
Implemented the benchmark script in python since it is much cleaner and simpler to maintain.
2014-02-28Make strtok benchmark competive.Ondřej Bílka1-57/+4
We include a generic version of strtok to result which could be faster when underlying primitives are better optimized than current version.
2014-02-26Consistently include Makeconfig after defining subdir.Joseph Myers1-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.
2014-02-21Minor formatting fixSiddhesh Poyarekar1-2/+2
2014-02-21print length in strrchr benchtestRajalakshmi Srinivasaraghavan1-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.
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka1-1/+1
2014-02-08tests: unify fortification handler logicMike Frysinger1-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>
2014-01-10Correct inputs for sin and cosSiddhesh Poyarekar2-29/+6
The inputs for the slowest path in asin and acos were incorrect and had some fast path inputs there too.
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae42-42/+42
2013-12-31Benchmark inputs for cos and sinSiddhesh Poyarekar2-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.
2013-12-31benchmark inputs for atanSiddhesh Poyarekar1-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.
2013-12-31benchmark inputs for tanh and atanhSiddhesh Poyarekar2-10/+400
2013-12-31benchmark inputs for asinh and acoshSiddhesh Poyarekar2-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.
2013-12-31benchmark inputs for sinh and coshSiddhesh Poyarekar2-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).
2013-12-31benchmark inputs for asin and acosSiddhesh Poyarekar2-14/+5240
Add a comprehensive set of inputs for asin and acos functions, including the multiple precision fallback path.
2013-12-19benchtests: Add strtok benchmarkRajalakshmi Srinivasaraghavan2-1/+206
2013-12-12benchmark inputs for exp2, log2, log and tanSiddhesh Poyarekar5-4/+4053
2013-12-05Accept output arguments to benchmark functionsSiddhesh Poyarekar3-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);
2013-12-02Benchmark test for sqrt function.Steve Ellcey2-1/+12
2013-11-26Also remove benchtests/bench-strsep-ifunc.cOndřej Bílka1-20/+0
2013-11-26Remove duplicate ifunc benchtests.Ondřej Bílka36-682/+2
2013-11-18benchtests: Add strsep benchmarkRajalakshmi Srinivasaraghavan3-1/+195
2013-11-132013-11-13 Steve Ellcey <sellcey@mips.com>Steve Ellcey1-0/+2
* benchtests/bench-timing.h: Include time.h.
2013-11-11benchtests: Add strtod benchmarkAdhemerval Zanella2-1/+120
2013-10-28Benchmark inputs for powSiddhesh Poyarekar1-0/+503
These inputs cover all normal processing paths for pow including all its slow paths.
2013-10-28New inputs for expSiddhesh Poyarekar1-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.
2013-10-10benchtests: Add include-sources directive.Torvald Riegel1-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.
2013-10-07Add more directives to benchmark input filesSiddhesh Poyarekar18-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.
2013-09-19Add benchmark inputs for sincosSiddhesh Poyarekar2-1/+89
2013-09-11benchtests: Rename argument to TIMING_INIT macro.Will Newton2-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.
2013-09-06benchtests: Add memrchr benchmarkAdhemerval Zanella4-4/+66
2013-09-06benchtests/Makefile: Run benchmark for memcpy.Will Newton1-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.
2013-09-04benchtests: Switch string benchmarks to use bench-timing.h.Will Newton27-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.
2013-09-04benchtests/Makefile: Use LDLIBS instead of LDFLAGS.Will Newton1-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.
2013-06-20Fix loop construction to functions callsAdhemerval Zanella2-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.
2013-06-11Port remaining string benchmarksSiddhesh Poyarekar5-1/+349
There were a few more string benchmarks (strcpy_chk and stpcpy_check) in the debug directory that needed to be ported over.
2013-06-11Copy over string performance tests into benchtestsSiddhesh Poyarekar61-1/+4991
Copy over already existing string performance tests into benchtests. Bits not related to performance measurements have been omitted.
2013-06-11Begin porting string performance tests to benchtestsSiddhesh Poyarekar5-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-*.
2013-06-10Avoid overwriting earlier flags in CPPFLAGS-nonlib in benchtestsSiddhesh Poyarekar1-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.
2013-05-22Sort benchmark functionsSiddhesh Poyarekar1-41/+42