aboutsummaryrefslogtreecommitdiff
path: root/benchtests
AgeCommit message (Collapse)AuthorFilesLines
2025-04-25benchtest: Correct shell script related to bench-malloc-threadHEADmasterCupertino Miranda1-1/+1
This patch changes the shell script that selects which arguments are used for the execution of bench-malloc-thread. The problem seems to have been introduced in commit: commit 2d6427a63cad8056ba6bcaaaa8df21977c8dde3d Author: Wangyang Guo <wangyang.guo@intel.com> Date: Fri Nov 29 16:05:35 2024 +0800 benchtests: Add calloc test With current condition, the following error "/bin/sh: 3: [[: not found" occurs when executing `make bench BENCHSET="malloc-thread"` and the else path is taken, using incorrect arguments for bench test execution. Error is reproducible in Debian based distros. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-03-18benchtests: Increase iterations of bench-malloc-simpleWilco Dijkstra1-1/+1
Increase iterations so it runs for ~1 second on modern CPUs. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-03-13x86_64: Add atanh with FMASunil K Pandey1-0/+1
On SPR, it improves atanh bench performance by: Before After Improvement reciprocal-throughput 15.1715 14.8628 2% latency 57.1941 56.1883 2% Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-03-13x86_64: Add sinh with FMASunil K Pandey1-0/+1
On SPR, it improves sinh bench performance by: Before After Improvement reciprocal-throughput 14.2017 11.815 17% latency 36.4917 35.2114 4% Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-03-13benchtests: Remove wrong snippet from 360cce0b06Adhemerval Zanella1-1/+0
2025-03-13nptl: Check if thread is already terminated in sigcancel_handler (BZ 32782)Adhemerval Zanella1-0/+1
The SIGCANCEL signal handler should not issue __syscall_do_cancel, which calls __do_cancel and __pthread_unwind, if the cancellation is already in proces (and libgcc unwind is not reentrant). Any cancellation signal received after is ignored. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Tested-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-03-05benchtests: Add random strlen benchmarkWilco Dijkstra2-0/+195
Add a new randomized strlen test similar to bench-random-memcpy. Instead of repeating the same call to strlen over and over again, it times a large number of different strings. The distribution of the string length and alignment is based on SPEC2017. Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-03-05benchtests: Improve large memcpy/memset benchmarksWilco Dijkstra4-43/+14
Adjust sizes between 64KB and 16MB and iterations based on length. Remove incorrect uses of alloc_bufs since we're not interested in measuring Linux clear_page time. Use getpagesize() - 1 instead of 4095 when aligning within a page. Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-02-12benchtests: Add tanpifAdhemerval Zanella2-0/+2410
Random inputs in the range of [-4,4]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-12benchtests: Add sinpifAdhemerval Zanella2-0/+2410
Random inputs in the range of [-4,4]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-12benchtests: Add cospifAdhemerval Zanella2-0/+2410
Random inputs in the range of [-4,4]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11benchtests: Add atanpifAdhemerval Zanella2-0/+2006
Random inputs in the range of [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11benchtests: Add atan2pifAdhemerval Zanella2-0/+2006
Random inputs in the range of [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11benchtests: Add asinpifAdhemerval Zanella2-0/+2711
Random inputs in the range of [-1,1]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-02-11benchtests: Add acospifAdhemerval Zanella2-0/+2711
Random inputs in the range of [-1,1]. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-01-16benchtests: Add dummy in put files cospi, cospif, sinpi, sinpif, tanpi, tanpifFlorian Weimer6-0/+24
This fixes an AArch64 build failure: python3 -B ../sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py bench-float-advsimd-cospi > …/benchtests/bench-float-advsimd-cospi.c Traceback (most recent call last): File "…/sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py", line 106, in <module> main(sys.argv[1]) ~~~~^^^^^^^^^^^^^ File "…/sysdeps/aarch64/fpu/scripts/bench_libmvec_advsimd.py", line 81, in main with open(f"../benchtests/libmvec/{input_filename}") as f: ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '../benchtests/libmvec/cospif-inputs'
2025-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert103-103/+103
2024-12-23include/sys/cdefs.h: Add __attribute_optimization_barrier__Adhemerval Zanella3-5/+5
Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18benchtests: Add tanhf benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add sinhf benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add coshf benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add atanhf benchmarkAdhemerval Zanella2-0/+2006
The input is based on acosf one (random inputs in [-1,1]). Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add atan2f benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add atanf benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add asinhf benchmarkAdhemerval Zanella2-0/+2006
Random inputs in the range [-10,10]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add asinf benchmarkAdhemerval Zanella2-0/+2711
The input is based on acosf one (random inputs in [-1,1]). Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add acoshf benchmarkAdhemerval Zanella2-0/+1006
Random inputs in the range [1,21]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-18benchtests: Add acosf benchmarkAdhemerval Zanella2-0/+2711
The input is based on acos one (random inputs in [-1,1]). Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-11benchtests: Add benchmark test for bsearchKuan-Wei Chiu2-0/+138
Introduce a benchmark test for the bsearch function to evaluate its performance. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com> Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-29benchtests: Add calloc testWangyang Guo5-5/+64
Two new benchmarks related to calloc added: - bench-calloc-simple - bench-calloc-thread Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-11-22benchtests: Add tanf benchmarkAdhemerval Zanella2-0/+3006
Random inputs in [-pi, pi]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-22benchtests: Add lgammaf benchmarkAdhemerval Zanella2-0/+1006
Random inputs in the range [-20.0,20.0]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-22benchtests: Add erfcf benchmarkAdhemerval Zanella2-0/+796
It is based on binary64 erfc-inputs, with random inputs in [0,b=0x1.41bbf6p+3] where b in the smallest number such that erfcf(b) rounds to 0 (to nearest). Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-22benchtests: Add erff benchmarkAdhemerval Zanella2-0/+796
It is based on binary64 erf-inputs, with random inputs in [0,b=0x1.f5a888p+1] where b in the smallest number such that erff(b) rounds to 1 (to nearest). Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-22benchtests: Add cbrtf benchmarkAdhemerval Zanella2-0/+1006
Based on binary64 benchtests, with random inputs in [1,8].
2024-11-01benchtests: Add log10p1f benchmarkAdhemerval Zanella2-0/+2889
It is based on log2f data. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add log1p benchmarkAdhemerval Zanella2-0/+1006
Random inputs x*2^e where x is random in [1/2,1] and e in [-29,127]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add log2p1f benchmarkAdhemerval Zanella2-0/+2889
It is based on log2f data. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add log10f benchmarkAdhemerval Zanella2-0/+1006
The inputs are random numbers in the form x*2^e where x is random in [0x1p-1,0x1p+0] and e in [-126,127]. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add expm1f benchmarkAdhemerval Zanella2-0/+800
The inputs are modeled based on expm1-inputs, with the range adapted to binary32 range. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add exp2m1f benchmarkAdhemerval Zanella2-0/+2389
The input is based on exp2f benchmark. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-01benchtests: Add exp10m1f benchmarkAdhemerval Zanella2-0/+2390
The input is based on exp10f benchmark. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-10-11replace tgammaf by the CORE-MATH implementationPaul Zimmermann2-0/+1007
The CORE-MATH implementation is correctly rounded (for any rounding mode). This can be checked by exhaustive tests in a few minutes since there are less than 2^32 values to check against for example GNU MPFR. This patch also adds some bench values for tgammaf. Tested on x86_64 and x86 (cfarm26). With the initial GNU libc code it gave on an Intel(R) Core(TM) i7-8700: "tgammaf": { "": { "duration": 3.50188e+09, "iterations": 2e+07, "max": 602.891, "min": 65.1415, "mean": 175.094 } } With the new code: "tgammaf": { "": { "duration": 3.30825e+09, "iterations": 5e+07, "max": 211.592, "min": 32.0325, "mean": 66.1649 } } With the initial GNU libc code it gave on cfarm26 (i686): "tgammaf": { "": { "duration": 3.70505e+09, "iterations": 6e+06, "max": 2420.23, "min": 243.154, "mean": 617.509 } } With the new code: "tgammaf": { "": { "duration": 3.24497e+09, "iterations": 1.8e+07, "max": 1238.15, "min": 101.155, "mean": 180.276 } } Signed-off-by: Alexei Sibidanov <sibid@uvic.ca> Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr> Changes in v2: - include <math.h> (fix the linknamespace failures) - restored original benchtests/strcoll-inputs/filelist#en_US.UTF-8 file - restored original wrapper code (math/w_tgammaf_compat.c), except for the dealing with the sign - removed the tgammaf/float entries in all libm-test-ulps files - address other comments from Joseph Myers (https://sourceware.org/pipermail/libc-alpha/2024-July/158736.html) Changes in v3: - pass NULL argument for signgam from w_tgammaf_compat.c - use of math_narrow_eval - added more comments Changes in v4: - initialize local_signgam to 0 in math/w_tgamma_template.c - replace sysdeps/ieee754/dbl-64/gamma_productf.c by dummy file Changes in v5: - do not mention local_signgam any more in math/w_tgammaf_compat.c - initialize local_signgam to 1 instead of 0 in w_tgamma_template.c and added comment Changes in v6: - pass NULL as 2nd argument of __ieee754_gammaf_r in w_tgammaf_compat.c, and check for NULL in e_gammaf_r.c Changes in v7: - added Signed-off-by line for Alexei Sibidanov (author of the code) Changes in v8: - added Signed-off-by line for Paul Zimmermann (submitted of the patch) Changes in v9: - address comments from review by Adhemerval Zanella Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-07benchtests: Add random memset benchmarkWilco Dijkstra2-0/+186
Add a new randomized memset test similar to bench-random-memcpy. Instead of repeating the same call to memset over and over again, it times a large number of different inputs. The distribution of memset length and alignment is based on SPEC2017 (length up to 4096 and alignment up to 64). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-06-21Benchtests: Remove broken walk benchmarksWilco Dijkstra6-581/+0
The walk benchmarks don't measure anything useful - memory is not initialized properly so doing a single walk in 32MB just measures reading the 4KB zero page for reads and clear_page overhead for writes. The memset variants don't even manage to do a walk in the 32MB region due to using incorrect pointer increments... Neither is it clear why it is walking backwards since this won't confuse modern prefetchers. If you fix the benchmark and print the bandwidth, the results are identical for all sizes larger than ~1KB since it is just testing memory bandwidth of a single 32MB block. This case is already tested by the large benchmark, so overall it doesn't seem useful to keep these. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-06-15Modernize and fix doc’s “Date and Time” (BZ 31876)Paul Eggert1-1/+1
POSIX.1-2024 (now official) specifies tm_gmtoff and tm_zone. This is a good time to update the manual’s “Date and Time” chapter so I went through it, fixed some outdated stuff that had been in there for decades, and improved it to match POSIX.1-2024 better and to clarify some implementation-defined behavior. Glibc already conforms to POSIX.1-2024 in these matters, so this is merely a documentation change. * manual/examples/strftim.c: Use snprintf instead of now-deprecated function asctime. Check for localtime failure. Simplify by using puts instead of fputs. Prefer ‘buf, sizeof buf’ to less-obvious ‘buffer, SIZE’. * manual/examples/timespec_subtract.c: Modernize to use struct timespec not struct timeval, and rename from timeval_subtract.c. All uses changed. Check for overflow. Do not check for negative return value, which ought to be OK since negative time_t is OK. Use GNU indenting style. * manual/time.texi: Document CLOCKS_PER_SEC, TIME_UTC, timespec_get, timespec_getres, strftime_l. Document the storage lifetime of tm_zone and of tzname. Caution against use of tzname, timezone and daylight, saying that these variables have unspecified values when TZ is geographic. This is what glibc actually does (contrary to what the manual said before this patch), and POSIX is planned to say the same thing <https://austingroupbugs.net/view.php?id=1816>. Also say that directly accessing the variables is not thread-safe. Say that localtime_r and ctime_r don’t necessarily set time zone state. Similarly, in the tzset documentation, say that it is called by ctime, localtime, mktime, strftime, not that it is called by all time conversion functions that depend on the time zone. Say that tm_isdst is useful mostly just for mktime, and that other uses should prefer tm_gmtoff and tm_zone instead. Do not say that strftime ignores tm_gmtoff and tm_zone, because it doesn’t do that. Document what gmtime does to tm_gmtoff and tm_zone. Say that the asctime, asctime_r, ctime, and ctime_r are now deprecated and/or obsolescent, and that behavior is undefined if the year is < 1000 or > 9999. Document strftime before these now-obsolescent functions, so that readers see the useful function first. Coin the terms “geographical format” and “proleptic format” for the two main formats of TZ settings, to simplify exposition. Use this wording consistently. Update top-level proleptic syntax to match POSIX.1-2024, which glibc already implements. Document the angle-bracket quoted forms of time zone abbreviations in proleptic TZ. Say that time zone abbreviations can contain only ASCII alphanumerics, ‘+’, and ‘-’. Document what happens if the proleptic form specifies a DST abbreviation and offset but omits the rules. POSIX says this is implementation-defined so we need to document it. Although this documentation mentions ‘posixrules’ tersely, we need to rethink ‘posixrules’ since I think it stops working after 2038. Clarify wording about TZ settings beginning with ‘;’. Say that timegm is in ISO C (as of C23). Say that POSIX.1-2024 removed gettimeofday. Say that tm_gmtoff and tm_zone are extensions to ISO C, which is clearer than saying they are invisible in a struct ISO C enviroment, and gives us more wiggle room if we want to make them visible in strict ISO C, something that ISO C allows. Drop mention of old standards like POSIX.1c and POSIX.2-1992 in the text when the history is so old that it’s no longer useful in a general-purpose manual. Define Coordinated Universal Time (UTC), time zone, time zone ruleset, and POSIX Epoch, and use these phrases more consistently. Improve TZ examples to show more variety, and to reflect current practice and timestamps. Remove obsolete example about Argentina. Add an example for Ireland. Don’t rely on GCC extensions when explaining ctime_r. Do not say that difftime produces the mathematically correct result, since it might be inexact. For clock_t don’t say “as in the example above” when there is no such example, and don’t say that casting to double works “properly and consistently no matter what”, as it suffers from rounding and overflow. Don’t say broken-down time is not useful for calculations; it’s merely painful. Say that UTC is not defined before 1960. Rename Time Zone Functions to Time Zone State. All uses changed. Update Internet RFC 822 → 5322, 1305 → 5905. Drop specific years of ISO 8601 as they don’t matter. Minor style changes: @code{"..."} → @t{"..."} to avoid overquoting in info files, @code → @env for environment variables, Daylight Saving Time → daylight saving time, white space → whitespace, prime meridian → Prime Meridian.
2024-05-16benchtests: Add fclose benchmarkH.J. Lu3-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>
2024-04-24benchtests: Add difficult strstr needle for bruteforce algorithmsWilco Dijkstra1-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>
2024-04-18benchtests: Add random() benchmarkWilco Dijkstra2-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>
2024-04-01benchtests: Improve benchtests for strstrAdhemerval Zanella1-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>