aboutsummaryrefslogtreecommitdiff
path: root/benchtests
AgeCommit message (Collapse)Author
2022-05-06benchtests: Add wcrtomb microbenchmarkSiddhesh Poyarekar
Add a simple benchmark that measures wcrtomb performance with various locales with 1-4 byte characters. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-04-29benchtests: Better libmvec integrationSiddhesh Poyarekar
Improve libmvec benchmark integration so that in future other architectures may be able to run their libmvec benchmarks as well. This now allows libmvec benchmarks to be run with `make BENCHSET=bench-math`. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-04-29benchtests: Add UNSUPPORTED benchmark statusSiddhesh Poyarekar
The libmvec benchmarks print a message indicating that a certain CPU feature is unsupported and exit prematurelyi, which breaks the JSON in bench.out. Handle this more elegantly in the bench makefile target by adding support for an UNSUPPORTED exit status (77) so that bench.out continues to have output for valid tests. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-04-27benchtests: Add pthread-mutex-locks benchWangyang Guo
Benchmark for testing pthread mutex locks performance with different threads and critical sections. The test configuration consists of 3 parts: 1. thread number 2. critical-section length 3. non-critical-section length Thread number starts from 1 and increased by 2x until num of CPU cores (nprocs). An additional over-saturation case (1.25 * nprocs) is also included. Critical-section is represented by a loop of shared do_filler(), length can be determined by the loop iters. Non-critical-section is similiar to the critical-section, except it's based on non-shared do_filler(). Currently, adaptive pthread_mutex lock is tested.
2022-04-22benchtests: Improve bench-strrchrNoah Goldstein
1. Use json-lib for printing results. 2. Expose all parameters (before pos, seek_char, and max_char where not printed). 3. Add benchmarks that test multiple occurence of seek_char in the string. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Use json-lib in bench-strncasecmp.cNoah Goldstein
Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Use json-lib in bench-strcasecmp.cNoah Goldstein
Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Use json-lib in bench-strspn.cNoah Goldstein
Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Use json-lib in bench-strpbrk.cNoah Goldstein
Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Add random benchmark in bench-strchr.cNoah Goldstein
Add benchmark that randomizes whether return should be NULL or pointer to CHAR. The rationale is on many architectures there is a choice between a predicate execution option (i.e cmovcc on x86) or a branch. On x86 the results for cmovcc vs branch are something along the lines of the following: perc-zero, Br On Result, Time Br / Time cmov 0.10, 1, ,0.983 0.10, 0, ,1.246 0.25, 1, ,1.035 0.25, 0, ,1.49 0.33, 1, ,1.016 0.33, 0, ,1.579 0.50, 1, ,1.228 0.50, 0, ,1.739 0.66, 1, ,1.039 0.66, 0, ,1.764 0.75, 1, ,0.996 0.75, 0, ,1.642 0.90, 1, ,1.071 0.90, 0, ,1.409 1.00, 1, ,0.937 1.00, 0, ,0.999 Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-25benchtests: Use json-lib in bench-strchr.cNoah Goldstein
Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-03-16benchtests: Use "=" instead of ":=" [BZ #28970]H.J. Lu
Use "=" instead of ":=" to allow sysdeps Makefiles to add more benches to bench and benchset. This fixes BZ #28970. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2022-03-08benchtests: make compare_strings.py accept string as attribute valueSu Lifan
Commit ac759b1fbf28a82d99afde9046f8b72c7cba5dae added attribute "overlap" to bench-memmove-walk, whose value is a string. This change makes compare_strings.py fail since benchout_strings.schema.json requires the values of attributes to be number. This patch relaxes such constraint. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-02-25benchtests: Generate .d dependency files [BZ #28922]H.J. Lu
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>
2022-02-25benchtests: Remove duplicated loop in bench-bzero-walk.cH.J. Lu
Remove one of 2 identical loops in bench-bzero-walk.c. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-02-24benchtests: Add small sizes (<= 64) to bench-bzero-walk.cH.J. Lu
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>
2022-02-23benchtests: Add benches for memset with 0 valueH.J. Lu
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>
2022-02-08benchtests: Add benches for bzeroH.J. Lu
Add bench-bzero-large.c, bench-bzero-walk.c and bench-bzero.c.
2022-02-07benchtests: Sort benches in MakefileH.J. Lu
Put one bench per line and sort them.
2022-02-06Benchtests: Add length zero benchmark for memset in bench-memset.cNoah Goldstein
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>
2022-02-05Benchtests: move 'alloc_bufs' from loop in bench-memset.cNoah Goldstein
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>
2022-02-03benchtests: Add more coverage for strcmp and strncmp benchmarksNoah Goldstein
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>
2022-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert
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
2021-11-06benchtests: Add partial overlap case in bench-memmove-walk.cNoah Goldstein
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>
2021-11-06benchtests: Add additional cases to bench-memcpy.c and bench-memmove.cNoah Goldstein
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>
2021-11-05Revert "benchtests: Add acosf function to bench-math"Sunil K Pandey
This reverts commit 79d0fc65395716c1d95931064c7bf37852203c66.
2021-11-01benchtests: Add hypotfAdhemerval Zanella
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>
2021-11-01benchtests: Make hypot input randomAdhemerval Zanella
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>
2021-10-29benchtests: Add acosf function to bench-mathSunil K Pandey
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>
2021-10-29benchtests: Improve bench-memcpy-randomWilco Dijkstra
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>
2021-10-27Benchtests: Add benchtests for __memcmpeqNoah Goldstein
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.
2021-10-23bench-math: Sort and put each bench per lineH.J. Lu
Sort and put each math bench per line to prepare for new math benches. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2021-10-08benchtests: Add medium cases and increase iters in bench-memset.cNoah Goldstein
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>
2021-10-04benchtests: Building benchmarks as static executablesH.J. Lu
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.
2021-09-24benchtests: Improve reliability of memcmp benchmarksNoah Goldstein
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>
2021-09-16benchtests: Fix validate_benchout.py exceptionsNaohiro Tamura
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>
2021-09-13benchtests: Remove redundant assert.hNaohiro Tamura
This patch removed redundant "#include <assert.h>" from bench-memset-large.c and bench-memset-walk.c. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2021-09-13benchtests: Enable scripts/plot_strings.py to read stdinNaohiro Tamura
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>
2021-08-18Remove sysdeps/*/tls-macros.hFangrui Song
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>
2021-08-02Remove obsolete comments/name from several benchtest input files.Paul Zimmermann
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>
2021-08-02Remove obsolete comments/name from acos-inputs, since slow path was removed.Paul Zimmermann
2021-07-28tests: use xmalloc to allocate implementation arraySiddhesh Poyarekar
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>
2021-05-26benchtests: Fixed bench-memcpy-random: buf1: mprotect failedNaohiro Tamura
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'
2021-05-23Bench: Add support for choose direction of memcpy in benchtestsNoah Goldstein
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>
2021-05-18x86: Expand bench-memcmp.c and test-memcmp.cNoah Goldstein
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>
2021-05-17benchtests: Use JSON for bench-rawmemchr outputMatheus Castanho
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>
2021-05-10add workload traces for cbrtlPaul Zimmermann
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>
2021-05-03Bench: Expand bench-memchr.cNoah Goldstein
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>
2021-05-03bench-memcpy: Collect data from 2KB to 4KBH.J. Lu
Collect data on memcpy from 2KB to 4KB with the 64-byte increment value.
2021-04-19x86: Expand test-memset.c and bench-memset.cNoah Goldstein
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>