about summary refs log tree commit diff
path: root/benchtests
Commit message (Collapse)AuthorAgeFilesLines
* benchtests: Generate .d dependency files [BZ #28922]H.J. Lu2022-02-251-2/+6
| | | | | | 1. Add all .o files to extra-objs. 2. Include ../Rules after extra-objs has been set. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* benchtests: Remove duplicated loop in bench-bzero-walk.cH.J. Lu2022-02-251-6/+0
| | | | | Remove one of 2 identical loops in bench-bzero-walk.c. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Add small sizes (<= 64) to bench-bzero-walk.cH.J. Lu2022-02-241-0/+3
| | | | | | Small sizes (<= 64) represent large portion of memset usages with zero value. Add sizes (<= 64) to bench-bzero-walk.c to cover small sizes. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* benchtests: Add benches for memset with 0 valueH.J. Lu2022-02-237-3/+149
| | | | | | | | | memset with zero as the value to set is by far the majority value (99%+ for Python3 and GCC). Add bench-memset-zero-large.c, bench-memset-zero-walk.c and bench-memset-zero.c to measure memset implementations for zeroing. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* benchtests: Add benches for bzeroH.J. Lu2022-02-084-0/+372
| | | | Add bench-bzero-large.c, bench-bzero-walk.c and bench-bzero.c.
* benchtests: Sort benches in MakefileH.J. Lu2022-02-071-19/+110
| | | | Put one bench per line and sort them.
* Benchtests: Add length zero benchmark for memset in bench-memset.cNoah Goldstein2022-02-061-1/+1
| | | | | | Zero is a relevant size for some workloads (roughly 5% of uses for GCC) so we should be testing it's performance as well. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Benchtests: move 'alloc_bufs' from loop in bench-memset.cNoah Goldstein2022-02-051-2/+2
| | | | | | One buf allocation is sufficient. Calling `alloc_bufs' in the loop just adds unnecessary syscall overhead. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add more coverage for strcmp and strncmp benchmarksNoah Goldstein2022-02-032-69/+183
| | | | | | | | | | | Add more small and medium sized tests for strcmp and strncmp. As well for strcmp add option for more direct control of alignment. Previously alignment was being pushed to the end of the page. While this is the most difficult case to implement, it is far from the common case and so shouldn't be the only benchmark. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-0184-84/+84
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* benchtests: Add partial overlap case in bench-memmove-walk.cNoah Goldstein2021-11-061-15/+46
| | | | | | | | This commit adds a new partial overlap benchmark. This is generally the most interesting performance case for memmove and was missing. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add additional cases to bench-memcpy.c and bench-memmove.cNoah Goldstein2021-11-062-9/+66
| | | | | | | | | | | | This commit adds more benchmarks for the common memcpy/memmove benchmarks. The most signifcant cases are the half page offsets. The current versions leaves dst and src near page aligned which leads to false 4k aliasing on x86_64. This can add noise due to false dependencies from one run to the next. As well, this seems like more of an edge case that common case so it shouldn't be the only thing Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Revert "benchtests: Add acosf function to bench-math"Sunil K Pandey2021-11-052-2710/+0
| | | | This reverts commit 79d0fc65395716c1d95931064c7bf37852203c66.
* benchtests: Add hypotfAdhemerval Zanella2021-11-012-0/+1008
| | | | | | | Based on random input arguments. About 85% tuples have exponents of the two arguments close together (+-1 range). Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Make hypot input randomAdhemerval Zanella2021-11-011-12/+1003
| | | | | | | | Instead of inputs based on the algorithm implementation details. About 85% tuples have exponents of the two arguments close together (+-1 range). Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add acosf function to bench-mathSunil K Pandey2021-10-292-0/+2710
| | | | | | | | | | | | | | | | | | Add acosf function to bench-math and copy acosf-inputs to benchtests. Motivation for this patch is to prepare for upcoming libmvec new functions. Float and double version of libmvec functions stays together. acosf-inputs file generated from acos-inputs file using following scaling formula: f = d * (FLT_MAX/DBL_MAX) Where d is input(double) and f is output(float). If scaled float value is duplicate in new input file, nextafterf() function used to find next float value, ensuring no duplicates. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Improve bench-memcpy-randomWilco Dijkstra2021-10-291-26/+28
| | | | | | | | Improve the random memcpy benchmark. Double the number of tests and increase the size of the memory region to test between 32KB and 1024KB. This improves accuracy on modern cores. Clean up formatting of the frequency array. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Benchtests: Add benchtests for __memcmpeqNoah Goldstein2021-10-273-7/+29
| | | | | | No bug. This commit adds __memcmpeq benchmarks. The benchmarks just use the existing ones in memcmp. This will be useful for testing implementations of __memcmpeq that do not just alias memcmp.
* bench-math: Sort and put each bench per lineH.J. Lu2021-10-231-6/+62
| | | | | | Sort and put each math bench per line to prepare for new math benches. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* benchtests: Add medium cases and increase iters in bench-memset.cNoah Goldstein2021-10-081-2/+2
| | | | | | | | | | No bug. This commit adds new medium size cases for lengths in [512, 1024). As well it increase the iters to INNER_LOOP_ITERS_LARGE for more reliable results. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* benchtests: Building benchmarks as static executablesH.J. Lu2021-10-042-7/+29
| | | | | | | | | | | | Building benchmarks as static executables: ========================================= To build benchmarks as static executables, on the build system, run: $ make STATIC-BENCHTESTS=yes bench-build You can copy benchmark executables to another machine and run them without copying the source nor build directories.
* benchtests: Improve reliability of memcmp benchmarksNoah Goldstein2021-09-241-11/+10
| | | | | | | | | | | | | | No bug. Remove reallocation of bufs between implementation tests. Move initialization outside of foreach implementation test loop. Increase iteration count. Generally before this commit was seeing a great deal of variability between runs. The goal of this commit is to make the results more reliable. Benchtests build and bench-memcmp succeeding. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* benchtests: Fix validate_benchout.py exceptionsNaohiro Tamura2021-09-163-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixed validate_benchout.py two exceptions, 1) AttributeError if benchout_strings.schema.json is specified, and 2) json.decoder.JSONDecodeError if benchout file is not JSON. $ ~/glibc/benchtests/scripts/validate_benchout.py bench-memset.out \ ~/glibc/benchtests/scripts/benchout_strings.schema.json Traceback (most recent call last): File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 86, in <module> sys.exit(main(sys.argv[1:])) File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 69, in main bench.parse_bench(args[0], args[1]) File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 139, in parse_bench do_for_all_timings(bench, lambda b, f, v: File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 107, in do_for_all_timings if 'timings' not in bench['functions'][func][k].keys(): AttributeError: 'str' object has no attribute 'keys' $ ~/glibc/benchtests/scripts/validate_benchout.py bench-math-inlines.out \ ~/glibc/benchtests/scripts/benchout_strings.schema.json Traceback (most recent call last): File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 86, in <module> sys.exit(main(sys.argv[1:])) File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 69, in main bench.parse_bench(args[0], args[1]) File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 137, in parse_bench bench = json.load(benchfile) File "/usr/lib/python3.6/json/__init__.py", line 299, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 342, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 17 (char 16) Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Remove redundant assert.hNaohiro Tamura2021-09-132-2/+0
| | | | | | | This patch removed redundant "#include <assert.h>" from bench-memset-large.c and bench-memset-walk.c. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Enable scripts/plot_strings.py to read stdinNaohiro Tamura2021-09-131-3/+8
| | | | | | | | | | | | | | | | | | | | This patch enables scripts/plot_strings.py to read a benchmark result file from stdin. To keep backward compatibility, that is to keep accepting multiple of benchmark result files in argument, blank argument doesn't mean stdin, but '-' does. Therefore nargs parameter of ArgumentParser.add_argument() method is not changed to '?', but keep '+'. ex: $ jq '.' bench-memset.out | plot_strings.py - $ jq '.' bench-memset.out | plot_strings.py - bench-memset-large.out $ plot_strings.py bench-memset.out bench-memset-large.out error ex: $ jq '.' bench-memset.out | plot_strings.py Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Remove sysdeps/*/tls-macros.hFangrui Song2021-08-181-22/+0
| | | | | | | | They provide TLS_GD/TLS_LD/TLS_IE/TLS_IE macros for TLS testing. Now that we have migrated to __thread and tls_model attributes, these macros are unused and the tls-macros.h files can retire. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Remove obsolete comments/name from several benchtest input files.Paul Zimmermann2021-08-026-23/+0
| | | | | | | | These comments refer to slow paths that were removed in glibc 2.34 or earlier. The corresponding "names" that yield separate workload traces for "make bench" are thus obsolete. We are however keeping the corresponding inputs. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Remove obsolete comments/name from acos-inputs, since slow path was removed.Paul Zimmermann2021-08-021-3/+0
|
* tests: use xmalloc to allocate implementation arraySiddhesh Poyarekar2021-07-281-2/+3
| | | | | | | | The benchmark and tests must fail in case of allocation failure in the implementation array. Also annotate the x* allocators in support.h so that the compiler has more information about them. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* benchtests: Fixed bench-memcpy-random: buf1: mprotect failedNaohiro Tamura2021-05-261-2/+2
| | | | | | | | This patch fixed mprotect system call failure on AArch64. This failure happened on not only A64FX but also ThunderX2. Also this patch updated a JSON key from "max-size" to "length" so that 'plot_strings.py' can process 'bench-memcpy-random.out'
* Bench: Add support for choose direction of memcpy in benchtestsNoah Goldstein2021-05-233-65/+94
| | | | | | | | | | This patch adds support for testing memcpy with both dst > src and dst < src. Since memcpy is implemented as memmove which has seperate control flows for certain sizes depending on dst > src it seems like 1) information that should be provided in the benchtest output and a variable that can be controlled for the benchmarks. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* x86: Expand bench-memcmp.c and test-memcmp.cNoah Goldstein2021-05-181-6/+26
| | | | | | | | | | | No bug. This commit adds some additional performance test cases to bench-memcmp.c and test-memcmp.c. The new benchtests include some medium range sizes, as well as small sizes near page cross. The new correctness tests correspond with the new benchtests though add some additional cases for checking the page cross logic. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Use JSON for bench-rawmemchr outputMatheus Castanho2021-05-171-15/+39
| | | | | | | | Convert the output of benchtests/bench-rawmemchr to JSON like other string benchmarks. This makes the output more parseable and allows usage of compare_strings.py, for example. Reviewed-by: Lucas A. M. Magalhaes <lamm@linux.ibm.com>
* add workload traces for cbrtlPaul Zimmermann2021-05-102-0/+1008
| | | | | | These workload traces cover the whole "long double" range. This patch was prepared with the help of Adhemerval Zanella. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Bench: Expand bench-memchr.cNoah Goldstein2021-05-031-0/+13
| | | | | | | | No bug. This commit adds some additional cases for bench-memchr.c including testing medium sizes and testing short length with both an inbound match and out of bound match. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* bench-memcpy: Collect data from 2KB to 4KBH.J. Lu2021-05-031-0/+8
| | | | Collect data on memcpy from 2KB to 4KB with the 64-byte increment value.
* x86: Expand test-memset.c and bench-memset.cNoah Goldstein2021-04-191-2/+4
| | | | | | | | | No bug. This commit adds tests cases and benchmarks for page cross and for memset to the end of the page without crossing. As well in test-memset.c this commit adds sentinel on start/end of tstbuf to test for overwrites Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* benchtests: Fix name of exp10f benchmark variantSiddhesh Poyarekar2021-04-181-1/+1
| | | | Variant names don't accept brackets.
* benchtests: Fix pthread-locks test to produce valid jsonSiddhesh Poyarekar2021-04-182-8/+11
| | | | | | | | | The benchtests json allows {function {variant}} categorization of results whereas the pthread-locks tests had {function {variant {subvariant}}}, which broke validation. Fix that by serializing the subvariants as variant-subvariant. Also update the schema to recognize the new benchmark attributes after fixing the naming conventions.
* x86: Expanding test-memmove.c, test-memcpy.c, bench-memcpy-large.cnoah2021-04-161-2/+6
| | | | | | | | | | | | No Bug. This commit expanding the range of tests / benchmarks for memmove and memcpy. The test expansion is mostly in the vein of increasing the maximum size, increasing the number of unique alignments tested, and testing both source < destination and vice versa. The benchmark expansaion is just to increase the number of unique alignments. test-memcpy, test-memccpy, test-mempcpy, test-memmove, and tst-memmove-overflow all pass. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
* add workload traces for missing functions (double format)Paul Zimmermann2021-03-2915-4/+13231
| | | | | | | | | | This patch adds workload traces for all double format functions where such files are missing. For each function, a set of 1000 random values is generated at random using SageMath, such that the output values are meaningful (for example avoiding too large inputs for exp10 where the output would be +Inf). More details about the generated values are given at the beginning of each file. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Add ilogb* testsRaphael Moreira Zinsly2021-03-164-2/+35
| | | | Add a benchtest to ilogb, ilogbf and ilogbf128 based on the logb* benchtests.
* benchtests: Updated json bench-variant attributeNaohiro Tamura2021-02-101-1/+1
| | | | | | | | | | This patch updates json "bench-variant" attribute of "bench-memset.c" to "default" so that the script "benchtests/scripts/plot_strings.py" can generate a file "memset_time_default_linear.png". Without this patch, the script "benchtests/scripts/plot_strings.py" generates a file "memset_time__linear.png" which has inconsistent form with "memcpy_time_default_linear.png" and "memmove_time_default_linear.png".
* strchr: Add additional benchmarks and testsnoah2021-02-081-1/+25
| | | | | | This patch adds additional benchmarks and tests for string size of 4096 and several benchmarks for string size 256 with different alignments.
* benchtests: Do not build bench-timing-type with MODULE_NAME=libcArjun Shankar2021-01-261-7/+7
| | | | | | | | | Since commit 2682695e5c7a, `make bench-build' with `--enable-static-pie' fails due to bench-timing-type being incorrectly built with MODULE_NAME set to `libc'. This commit sets MODULE_NAME to nonlib, thus fixing the build failure. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* install: Replace scripts/output-format.sed with objdump -f [BZ #26559]Fangrui Song2021-01-111-1/+0
| | | | | | | | | | | | | | GNU ld and gold have supported --print-output-format since 2011. glibc requires binutils>=2.25 (2015), so if LD is GNU ld or gold, we can assume the option is supported. lld is by default a cross linker supporting multiple targets. It auto detects the file format and does not need OUTPUT_FORMAT. It does not support --print-output-format. By parsing objdump -f, we can support all the three linkers. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-0283-84/+84
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* New benchtest: pthread locksDJ Delorie2020-10-212-1/+556
| | | | | | | | Performance benchmarks for various posix locks: mutex, rwlock, spinlock, condvar, and semaphore. Each test is performed with an empty loop body or with a computationally "interesting" (i.e. difficult to optimize away, and used just to allow lock code to be "hidden" in the filler's CPU cycles).
* bench-strcmp.c: Add workloads on page boundaryH.J. Lu2020-09-241-0/+56
| | | | Add strcmp workloads on page boundary.
* bench-strncmp.c: Add workloads on page boundaryH.J. Lu2020-09-241-0/+128
| | | | Add strncmp workloads on page boundary.