about summary refs log tree commit diff
path: root/benchtests
Commit message (Collapse)AuthorAgeFilesLines
* benchtests: Add fclose benchmarkH.J. Lu6 days3-0/+82
| | | | | | | Measure duration of 100 fclose calls after opening 1 million FILEs. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* benchtests: Add difficult strstr needle for bruteforce algorithmsWilco Dijkstra2024-04-241-0/+27
| | | | | | | Add another difficult needle to strstr that clearly shows the quadratic complexity of bruteforce algorithms. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* benchtests: Add random() benchmarkWilco Dijkstra2024-04-182-0/+107
| | | | | | | | | | Add a simple benchmark to measure the overhead of internal libc locks in the random() implementation on both single- and multi-threaded cases. This relies on the implementation of random using internal locks to access shared global data, and that the runtime uses multi-threaded locking once a thread has been created (even after it finishes). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* benchtests: Improve benchtests for strstrAdhemerval Zanella2024-04-011-76/+273
| | | | | | | Use same strategy as bench-strstr.c (93eebae5168e5cf2 and 80b2bfb53504) and use json_ctx for output to help standardize format across all benchtests. Reviewed-by: Arjun Shankar <arjun@redhat.com>
* benchtests: Add more benchtests for rounding functions.Junxian Zhu2024-02-2312-0/+233
| | | | | | This patch adds more benchtests for rounding functions. The double inputs are copied from trunc-inputs, the float inputs are copied from truncf-inputs. and the rintf is copied from rint-inputs. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Increase benchmark iterationsWilco Dijkstra2024-01-122-2/+2
| | | | | | | Increase benchmark iterations for math and vector math functions to improve timing accuracy. Vector math benchmarks now take 1-3 seconds on a modern CPU. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-01102-102/+102
|
* benchtests: fix warn unused resultFrederic Berat2023-06-221-1/+5
| | | | | | | Few tests needed to properly check for asprintf and system calls return values with _FORTIFY_SOURCE enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Fix all the remaining misspellings -- BZ 25337Paul Pluzhnikov2023-06-023-5/+5
|
* benchtests: Reformat Makefile.Carlos O'Donell2023-05-181-15/+32
| | | | | | | | | Reflow all long lines adding comment terminators. Sort all reflowed text using scripts/sort-makefile-lines.py. No regressions running microbenchmarks. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
* Enable libmvec support for AArch64Joe Ramsay2023-05-031-0/+88
| | | | | | | | | | | | | | | | | | | | | | | This patch enables libmvec on AArch64. The proposed change is mainly implementing build infrastructure to add the new routines to ABI, tests and benchmarks. I have demonstrated how this all fits together by adding implementations for vector cos, in both single and double precision, targeting both Advanced SIMD and SVE. The implementations of the routines themselves are just loops over the scalar routine from libm for now, as we are more concerned with getting the plumbing right at this point. We plan to contribute vector routines from the Arm Optimized Routines repo that are compliant with requirements described in the libmvec wiki. Building libmvec requires minimum GCC 10 for SVE ACLE. To avoid raising the minimum GCC by such a big jump, we allow users to disable libmvec if their compiler is too old. Note that at this point users have to manually call the vector math functions. This seems to be acceptable to some downstream users. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Benchtests: Adjust timingWilco Dijkstra2023-04-1711-11/+11
| | | | | | | | Adjust iteration counts so benchmarks don't run too slowly or quickly. Ensure benchmarks take less than 10 seconds on older, slower cores and more than 0.5 seconds on fast cores. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* compare_strings.py : Add --gmean flagNisha Menon2023-04-041-2/+18
| | | | | | To calculate geometric mean for string benchmark results. Signed-off-by: Nisha Poyarekar <nisha.s.menon@gmail.com>
* benchtests: Add fmodf benchmarkAdhemerval Zanella Netto2023-04-032-0/+2183
| | | | | | | | | 1. Subnormals: 128 inputs. 2. Normal numbers with large exponent difference (|x/y| > 2^8): 1024 inputs between FLT_MIN and FLT_MAX; 3. Close exponents (ey >= -103 and |x/y| < 2^8): 1024 inputs with exponents between -10 and 10. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
* benchtests: Add fmod benchmarkAdhemerval Zanella Netto2023-04-032-0/+2183
| | | | | | | | | | | Add three different dataset, from random floating point numbers: 1. Subnormals: 128 inputs. 2. Normal numbers with large exponent difference (|x/y| > 2^52): 1024 inputs between DBL_MIN and DBL_MAX; 3. Close exponents (ey >= -907 and |x/y| < 2^52): 1024 inputs with exponents between -10 and 10. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
* benchtests: Move libmvec benchtest inputs to benchtests directoryJoe Ramsay2023-03-2752-0/+213200
| | | | | | | This allows other targets to use the same inputs for their own libmvec microbenchmarks without having to duplicate them in their own subdirectory. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Benchtests: Remove simple_str(r)chrWilco Dijkstra2023-03-082-31/+38
| | | | | | | | Instead of benchmarking slow byte oriented loops, include the optimized generic strchr and strrchr implementation. Adjust iteration count to reduce benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_str(n)casecmpWilco Dijkstra2023-03-082-37/+2
| | | | | | | Remove the slow byte oriented loops. Adjust iteration count to reduce benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_memcmpWilco Dijkstra2023-03-081-31/+1
| | | | | | Remove the slow byte oriented simple_memcmp. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_strcspn/strpbrk/strsepWilco Dijkstra2023-03-085-177/+4
| | | | | | | | | Remove simple_strcspn/strpbrk/strsep which are significantly slower than the generic implementations. Also remove oldstrsep and oldstrtok since they are practically identical to the generic implementation. Adjust iteration count to reduce benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove memchr_strnlenWilco Dijkstra2023-03-082-11/+2
| | | | | | | | Remove memchr_strnlen since it is now the same as generic_strnlen. Adjust iteration count to reduce benchmark time. Keep memchr_strlen since the generic strlen does not use memchr. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_mem(r)chrWilco Dijkstra2023-03-082-30/+26
| | | | | | | | Instead of benchmarking slow byte oriented loops, include the optimized generic memchr/memrchr implementation. Adjust iteration count to reduce benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_strcpy_chkWilco Dijkstra2023-03-082-27/+1
| | | | | | | Remove the slow byte oriented simple_strcpy_chk and simple_stpcpy_chk. Adjust iteration count to increase benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Benchtests: Remove simple_str(n)cmpWilco Dijkstra2023-03-082-74/+24
| | | | | | | Instead of benchmarking slow byte oriented loops, include the optimized generic strcmp/strncmp implementation. Adjust iteration count to reduce benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Replace rawmemchr (s, '\0') with strchrWilco Dijkstra2023-02-062-2/+2
| | | | | | | | | Almost all uses of rawmemchr find the end of a string. Since most targets use a generic implementation, replacing it with strchr is better since that is optimized by compilers into strlen (s) + s. Also fix the generic rawmemchr implementation to use a cast to unsigned char in the if statement. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-06101-101/+101
|
* benchtests: Make str{n}{cat|cpy} benchmarks output jsonNoah Goldstein2022-11-084-115/+297
| | | | | Json output is easier to parse and most other benchmarks already do the same.
* string: Add len=0 to {w}memcmp{eq} tests and benchtestsNoah Goldstein2022-11-081-9/+9
| | | | | len=0 is valid and fairly common so should be tested. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Disable use of -fsignaling-nans if compiler does not support itAdhemerval Zanella2022-11-011-3/+3
| | | | Reviewed-by: Fangrui Song <maskray@google.com>
* Bench: Improve benchtests for memchr, strchr, strnlen, strrchrNoah Goldstein2022-10-195-45/+137
| | | | | | 1. Add more complete coverage in the medium size range. 2. In strnlen remove the `1 << i` which was UB (`i` could go beyond 32/64)
* Benchtests: Add bench for pthread_spin_{try}lock and mutex_trylockNoah Goldstein2022-10-036-12/+151
| | | | | Reuses infrastructure from previous pthread_mutex_lock benchmarks to test other performance sensitive functions.
* Benchtest: Add additional benchmarks for strlen and strnlenNoah Goldstein2022-09-282-7/+81
| | | | | Current benchmarks are missing many cases in the mid-length range which is often the hottest size range.
* benchtests: Add arc4random benchtestAdhemerval Zanella Netto2022-07-225-3/+230
| | | | | | | | It shows both throughput (total bytes obtained in the test duration) and latecy for both arc4random and arc4random_buf with different sizes. Checked on x86_64-linux-gnu, aarch64-linux, and powerpc64le-linux-gnu.
* Benchtests: Improve memrchr benchmarksNoah Goldstein2022-06-071-45/+65
| | | | | | | | | | Add a second iteration for memrchr to set `pos` starting from the end of the buffer. Previously `pos` was only set relative to the beginning of the buffer. This isn't really useful for memrchr because the beginning of the search space is (buf + len). Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add workload name for sincosfAdhemerval Zanella2022-06-011-0/+1
| | | | | | So it can show both reciprocal-throughput and latency. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add workload name for cosfAdhemerval Zanella2022-06-011-1/+1
| | | | | | So it can show both reciprocal-throughput and latency. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Improve benchtests for strstr, memmem, and memchrNoah Goldstein2022-05-273-92/+283
| | | | | | | | | 1. Use json_ctx for output to help standardize format across all benchtests. 2. Add some additional tests to strstr and memchr expanding alignments and adding more small values. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Improve bench-strnlen.cNoah Goldstein2022-05-231-25/+52
| | | | | | | 1. Output results in json format so its easier to parse 2. Increase max alignment to `getpagesize () - 1` to make it possible to test page cross cases. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* elf: Optimize _dl_new_hash in dl-new-hash.hNoah Goldstein2022-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unroll slightly and enforce good instruction scheduling. This improves performance on out-of-order machines. The unrolling allows for pipelined multiplies. As well, as an optional sysdep, reorder the operations and prevent reassosiation for better scheduling and higher ILP. This commit only adds the barrier for x86, although it should be either no change or a win for any architecture. Unrolling further started to induce slowdowns for sizes [0, 4] but can help the loop so if larger sizes are the target further unrolling can be beneficial. Results for _dl_new_hash Benchmarked on Tigerlake: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz Time as Geometric Mean of N=30 runs Geometric of all benchmark New / Old: 0.674 type, length, New Time, Old Time, New Time / Old Time fixed, 0, 2.865, 2.72, 1.053 fixed, 1, 3.567, 2.489, 1.433 fixed, 2, 2.577, 3.649, 0.706 fixed, 3, 3.644, 5.983, 0.609 fixed, 4, 4.211, 6.833, 0.616 fixed, 5, 4.741, 9.372, 0.506 fixed, 6, 5.415, 9.561, 0.566 fixed, 7, 6.649, 10.789, 0.616 fixed, 8, 8.081, 11.808, 0.684 fixed, 9, 8.427, 12.935, 0.651 fixed, 10, 8.673, 14.134, 0.614 fixed, 11, 10.69, 15.408, 0.694 fixed, 12, 10.789, 16.982, 0.635 fixed, 13, 12.169, 18.411, 0.661 fixed, 14, 12.659, 19.914, 0.636 fixed, 15, 13.526, 21.541, 0.628 fixed, 16, 14.211, 23.088, 0.616 fixed, 32, 29.412, 52.722, 0.558 fixed, 64, 65.41, 142.351, 0.459 fixed, 128, 138.505, 295.625, 0.469 fixed, 256, 291.707, 601.983, 0.485 random, 2, 12.698, 12.849, 0.988 random, 4, 16.065, 15.857, 1.013 random, 8, 19.564, 21.105, 0.927 random, 16, 23.919, 26.823, 0.892 random, 32, 31.987, 39.591, 0.808 random, 64, 49.282, 71.487, 0.689 random, 128, 82.23, 145.364, 0.566 random, 256, 152.209, 298.434, 0.51 Co-authored-by: Alexander Monakov <amonakov@ispras.ru> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Add benchtests for dl_elf_hash, dl_new_hash and nss_hashNoah Goldstein2022-05-237-8/+335
| | | | | | Benchtests are for throughput and include random / fixed size benchmarks. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests: Add wcrtomb microbenchmarkSiddhesh Poyarekar2022-05-062-0/+140
| | | | | | | | 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>
* benchtests: Better libmvec integrationSiddhesh Poyarekar2022-04-291-15/+17
| | | | | | | | 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>
* benchtests: Add UNSUPPORTED benchmark statusSiddhesh Poyarekar2022-04-291-5/+18
| | | | | | | | | | | | 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>
* benchtests: Add pthread-mutex-locks benchWangyang Guo2022-04-272-0/+290
| | | | | | | | | | | | | | | | | | | | 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.
* benchtests: Improve bench-strrchrNoah Goldstein2022-04-221-44/+82
| | | | | | | | | 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>
* benchtests: Use json-lib in bench-strncasecmp.cNoah Goldstein2022-03-251-44/+69
| | | | | | Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Use json-lib in bench-strcasecmp.cNoah Goldstein2022-03-251-26/+51
| | | | | | Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Use json-lib in bench-strspn.cNoah Goldstein2022-03-251-20/+58
| | | | | | Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Use json-lib in bench-strpbrk.cNoah Goldstein2022-03-251-20/+61
| | | | | | Just QOL change to make parsing the output of the benchtests more consistent. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* benchtests: Add random benchmark in bench-strchr.cNoah Goldstein2022-03-251-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>