aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-memcpy-large.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2024-03-18 15:05:38 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2025-03-05 13:29:48 +0000
commitdac7ea4a6fb8111e60fc35c104302800cf986ad2 (patch)
treeb121126bd84061ad0e1f807923c52fbcafe95f7e /benchtests/bench-memcpy-large.c
parent226476e32251b5688eead482a9338c04ce84d715 (diff)
downloadglibc-dac7ea4a6fb8111e60fc35c104302800cf986ad2.tar.xz
glibc-dac7ea4a6fb8111e60fc35c104302800cf986ad2.zip
benchtests: Improve large memcpy/memset benchmarks
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>
Diffstat (limited to 'benchtests/bench-memcpy-large.c')
-rw-r--r--benchtests/bench-memcpy-large.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/benchtests/bench-memcpy-large.c b/benchtests/bench-memcpy-large.c
index cb83bac2bf..c5bd759dd5 100644
--- a/benchtests/bench-memcpy-large.c
+++ b/benchtests/bench-memcpy-large.c
@@ -19,10 +19,9 @@
#ifndef MEMCPY_RESULT
# define MEMCPY_RESULT(dst, len) dst
# define START_SIZE (64 * 1024)
-# define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024)
+# define MIN_PAGE_SIZE (getpagesize () + 16 * 1024 * 1024)
# define TEST_MAIN
# define TEST_NAME "memcpy"
-# define TIMEOUT (20 * 60)
# include "bench-string.h"
IMPL (memcpy, 1)
@@ -36,7 +35,7 @@ static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, const char *src,
size_t len)
{
- size_t i, iters = 16;
+ size_t i, iters = (MIN_PAGE_SIZE * 8) / len;
timing_t start, stop, cur;
TIMING_NOW (start);
@@ -59,12 +58,7 @@ do_test (json_ctx_t *json_ctx, size_t align1, size_t align2, size_t len,
char *s1, *s2;
size_t repeats;
align1 &= 4095;
- if (align1 + len >= page_size)
- return;
-
align2 &= 4095;
- if (align2 + len >= page_size)
- return;
s1 = (char *) (buf1 + align1);
s2 = (char *) (buf2 + align2);