about summary refs log tree commit diff
path: root/benchtests/bench-memset-zero-walk.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-02-09 07:31:41 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-02-23 12:07:06 -0800
commitcf975913131169a753acf0621e08e72bc40a91e2 (patch)
treec6bd75c58e59b32546e5744e29e086feb7072bee /benchtests/bench-memset-zero-walk.c
parent0f88a5c66e1cbb574bf37d953bf7155c0a1f5ae7 (diff)
downloadglibc-cf975913131169a753acf0621e08e72bc40a91e2.tar.gz
glibc-cf975913131169a753acf0621e08e72bc40a91e2.tar.xz
glibc-cf975913131169a753acf0621e08e72bc40a91e2.zip
benchtests: Add benches for memset with 0 value
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>
Diffstat (limited to 'benchtests/bench-memset-zero-walk.c')
-rw-r--r--benchtests/bench-memset-zero-walk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchtests/bench-memset-zero-walk.c b/benchtests/bench-memset-zero-walk.c
new file mode 100644
index 0000000000..dce4b43e06
--- /dev/null
+++ b/benchtests/bench-memset-zero-walk.c
@@ -0,0 +1,20 @@
+/* Measure memset functions for zeroing throughput with large data sizes.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#define DO_MEMSET 1
+#include "bench-bzero-walk.c"