From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2050.outbound.protection.outlook.com [40.107.6.50]) by sourceware.org (Postfix) with ESMTPS id BED4B3858C20 for ; Thu, 23 Mar 2023 11:55:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BED4B3858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4CeCNxklCFrEONWYTT/3V3wvKsQaGmeoAoMOl5x5/MQ=; b=6aNGMQmYcr8sKs3DEarb5HfKgXaxsyZK/zWBzXvm/KmiH7UXfDz+BEtSrXTOqfYL1cE6r8DhSX47KA6WnzdAA+gbB8GU8eTHX+59dvJT4p61Pld6+i5WUkVXyQBTgsBFnK+Hkzm4sa+GmrWbowUhsb7vyZ653Llte368wET9PXw= Received: from AM6P193CA0054.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::31) by GV2PR08MB8194.eurprd08.prod.outlook.com (2603:10a6:150:74::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Thu, 23 Mar 2023 11:55:31 +0000 Received: from AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8e:cafe::31) by AM6P193CA0054.outlook.office365.com (2603:10a6:209:8e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38 via Frontend Transport; Thu, 23 Mar 2023 11:55:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT037.mail.protection.outlook.com (100.127.140.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.17 via Frontend Transport; Thu, 23 Mar 2023 11:55:31 +0000 Received: ("Tessian outbound b29c0599cbc9:v135"); Thu, 23 Mar 2023 11:55:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8216968a0d1ed225 X-CR-MTA-TID: 64aa7808 Received: from 2491efd95b55.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E95CDB7C-2FD9-4C1B-9A0D-943E62C0473F.1; Thu, 23 Mar 2023 11:55:25 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2491efd95b55.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Mar 2023 11:55:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amm0Of9qiDjxlT78tyGRRuW7mzuN/1K64pbAhfhwnfiHn+dv7j1nyQEc3DzAAmkT4hfjojk32wijZKtoW+/dtnG62GWkqkSQy4Of6M5LeBo+Zh6WSv0MrmpShRz6VqmLFV+gPuYsMFFfFh1RZN4AhCSy56YCgYNpglM9JAHX9QILYixr8V8FkmAMmA4CV15Qy1ikeJ5QmhyrX95CSxxz/xamnKLvDn0OKMJYGcUuSCDL6b5Zod5CnHEteZarNJpO+5blShtPMKQjSOnJpcDOo77Y0rgtMiubZof3VZyyfPdQgRf2OEF1ZyrincPTspLgo0oVT3AWXaaNapshURfiGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4CeCNxklCFrEONWYTT/3V3wvKsQaGmeoAoMOl5x5/MQ=; b=NIqNYoHsLs7vm5p7cBzlsHTUazh3zsP6dqCpyCwUN+R7VXNlXlRmkTaI/Ju8q0NER+9cPwACImCjT/RyTvu7FysGr9WBjFS6rBI10rjx9qFkzHQDqySrB62DjoJzGuFi7JI1YSZWVQvsSX+3u9gMnk1GDdKENx3J5UeN2n7HhUYi0/0FZQwlWieUkn5iu+nudmy451zSA7do7ncrpQa7k7ooLiBuz99lguiGny2Soxa310cBN4bu96rHBruJLWUwqjNFPKSscFgLg58178jj7g534l8INN1PFPeerP7pbyzRYv9Hg7LJgAj6XIOwQrIh1cbo0LPHDh9ehVw59Fd4Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4CeCNxklCFrEONWYTT/3V3wvKsQaGmeoAoMOl5x5/MQ=; b=6aNGMQmYcr8sKs3DEarb5HfKgXaxsyZK/zWBzXvm/KmiH7UXfDz+BEtSrXTOqfYL1cE6r8DhSX47KA6WnzdAA+gbB8GU8eTHX+59dvJT4p61Pld6+i5WUkVXyQBTgsBFnK+Hkzm4sa+GmrWbowUhsb7vyZ653Llte368wET9PXw= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AS8PR08MB6680.eurprd08.prod.outlook.com (2603:10a6:20b:397::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 11:55:20 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573%8]) with mapi id 15.20.6178.037; Thu, 23 Mar 2023 11:55:20 +0000 From: Wilco Dijkstra To: 'GNU C Library' Subject: [PATCH] Benchtests: Remove broken walk benchmarks Thread-Topic: [PATCH] Benchtests: Remove broken walk benchmarks Thread-Index: AQHZXXznUfXV2KZcg0202r/6BbHHxw== Date: Thu, 23 Mar 2023 11:55:20 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|AS8PR08MB6680:EE_|AM7EUR03FT037:EE_|GV2PR08MB8194:EE_ X-MS-Office365-Filtering-Correlation-Id: 38e9119c-8892-4321-7cff-08db2b9580dd x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gC52ttRivwW5PSyy70yj5HPC0Kj/JF95cD6IhuiySAvsMZ9vt21DeeNS3LAg5LSUsKBvhFWNjEkHrusRf4uaqQzFVp1SfPN4Dd7kkLS9DNMDDIpf8601v/sYgn7cOhoszrmLfPlbvrx+0exS855cJuZSLhWZAhSSrb2L2n8oL4xDLLzdWW7Cq2wGCEnYTL1InBu4iZqzefVLFAK8yZZFdELo0M03c0TbX4ehmTEo9JNuCO2H8bv8WpNit5x9x5FVwKX/xskeGN9Q10vL2c2bxbl6GBFiNwXlRFVcq/SmjMZPg/7kWzwuXsTrYW9JAVJQc4cEn0En+lyaYkZVSVmFiaGJufNbv9xOdzJl6uAqNBDa8kipMB/amjLaOb2W95+nhngXpapmVSHQl+qehQa8T949t/QhZiTyo3N8da9c+soTzQI4bZqPwkGnmIC4P9j90Y00tN5D5oBNTBUOBsP8Qs2S2iWK8wolMsTi+3Cef7iVwti7mi4tY6gZcQmf9LeYq5YOmqV7fcu+Ms3cmjwotwjMMWGeWMHK1JzFVhihHc3uYS9thvWg2+GmgHds7KpDxalvWxhdE2zB/ExnCDVlSTIv93XRBAd9KN24/0hUzgPYMMJGdoT76uSbTMKkVYTem7zEx8wqbSenE2yUKqCG7iBo3H3vhvBOsLUULoBuLcsFyuM0+lmTPZ51m6+w/30r+w1JvHfsc2nyJMGKSeim6Q== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8982.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199018)(38100700002)(55016003)(2906002)(38070700005)(478600001)(83380400001)(7696005)(186003)(9686003)(86362001)(33656002)(71200400001)(316002)(91956017)(66556008)(66476007)(66446008)(64756008)(8676002)(66946007)(6916009)(76116006)(52536014)(8936002)(30864003)(26005)(6506007)(122000001)(5660300002)(41300700001)(2004002)(579004);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6680 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fa808505-b643-437b-e3bb-08db2b957a52 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TxILNo6hWk+gMX0sm4Lap521BnRLGoFe6PsRXJxyFqzI5yQiTrNEjWRCwSg2/KnNGrlXzm+ohYjhkODMn562wB96dkQh4PvE8esbUNG6OJuf//Gkq+q/2Hn3NOykXeDWmXwzWleuIoEZPZdaaUI6eIAnXUxnz310dRu0mi5wCIhISJvSc/UJFKv+wjkcHHZeEDmVB2dTSSQZ1ecy7T39oChHbkr/lZBg6XCjz0zz/rX1WdbfSNqm4z29XGCZ9e/iwHWRlcoQEvcL5N5PkbKhKpGawz0Da17JvUl0JtnyiUxLNJAUAp7COW1Y+RIIMY/Yikh0vJeiR5RHThxZygC1w7tQtipbMzVw/Zz/PMCwbbd8AtlTbPr68+zgVcTCPNFJQqsi2jXD3lmQ5mhF2IK/ab+eNquyD6pf93kUh4UFY4pzR2ppc5ohQZzabeltxfsPerBECM3s2ouSFYBuLvQsNFUsuE0CbH5N2W9UdynfQepQo2DiUr40cDKOI20VFitkxxdRESabQYRx1WTj2/CJHzxN497WAbeArlHcub7NhrLOAQXx7YKDerv9v+B9CgTcjLrsER0eV0pI8S6rM/g473gza+YEK8ON1ayQO7QhWr6rNoFY1RvN4tcGqpSWOFp2LJZU4EcdXYQl/q68i/PDzbU7fijU9dlpXDh6qGS6ptxpG59mVzuKhtfPiVA1QXLLWcUQ2xB+F1NXcc0I0vwQxg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(396003)(39860400002)(346002)(451199018)(36840700001)(46966006)(40470700004)(82310400005)(83380400001)(47076005)(7696005)(316002)(336012)(5660300002)(33656002)(186003)(26005)(9686003)(478600001)(8936002)(6506007)(40480700001)(55016003)(86362001)(30864003)(36860700001)(81166007)(8676002)(70586007)(356005)(52536014)(70206006)(40460700003)(82740400003)(6916009)(41300700001)(2906002)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 11:55:31.4396 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38e9119c-8892-4321-7cff-08db2b9580dd X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8194 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_LOTSOFHASH,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: =0A= The walk benchmarks don't measure anything useful - memory is not initializ= ed=0A= properly so doing a single walk in 32MB just measures reading the 4KB zero= =0A= page for reads and clear_page overhead for writes. The memset variants don= 't=0A= even manage to do a walk in the 32MB region due to using incorrect pointer= =0A= increments... Neither is it clear why it is walking backwards since this= =0A= won't confuse modern prefetchers. If you fix the benchmark and print the= =0A= bandwidth, the results are identical for all sizes larger than ~1KB since i= t=0A= is just testing memory bandwidth of a single 32MB block. This case is alre= ady=0A= tested by the large benchmark, so overall it doesn't seem useful to keep th= ese.=0A= =0A= ---=0A= =0A= diff --git a/benchtests/Makefile b/benchtests/Makefile=0A= index 721f32afdbc93da42b4f4ce6ba09e92c18613607..0c2b396d6935ecb3fbd5620c076= a8ba33e7f3f7a 100644=0A= --- a/benchtests/Makefile=0A= +++ b/benchtests/Makefile=0A= @@ -125,7 +125,6 @@ bench-string :=3D \=0A= string-benchset :=3D \=0A= bzero \=0A= bzero-large \=0A= - bzero-walk \=0A= memccpy \=0A= memchr \=0A= memcmp \=0A= @@ -133,19 +132,15 @@ string-benchset :=3D \=0A= memcpy \=0A= memcpy-large \=0A= memcpy-random \=0A= - memcpy-walk \=0A= memmem \=0A= memmove \=0A= memmove-large \=0A= - memmove-walk \=0A= mempcpy \=0A= memrchr \=0A= memset \=0A= memset-large \=0A= - memset-walk \=0A= memset-zero \=0A= memset-zero-large \=0A= - memset-zero-walk \=0A= rawmemchr \=0A= stpcpy \=0A= stpcpy_chk \=0A= diff --git a/benchtests/bench-bzero-walk.c b/benchtests/bench-bzero-walk.c= =0A= deleted file mode 100644=0A= index 77bdabeb0d44d7150a78bd345c97edf88b133735..000000000000000000000000000= 0000000000000=0A= --- a/benchtests/bench-bzero-walk.c=0A= +++ /dev/null=0A= @@ -1,143 +0,0 @@=0A= -/* Measure memset function throughput with large data sizes.=0A= - Copyright (C) 2017-2023 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#define TEST_MAIN=0A= -#ifdef DO_MEMSET=0A= -# define TEST_NAME "memset"=0A= -#else=0A= -# define TEST_NAME "bzero"=0A= -#endif=0A= -#define START_SIZE 128=0A= -#define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024)=0A= -#define TIMEOUT (20 * 60)=0A= -#include "bench-string.h"=0A= -=0A= -#include "json-lib.h"=0A= -=0A= -#ifdef DO_MEMSET=0A= -void *generic_memset (void *, int, size_t);=0A= -=0A= -typedef void *(*proto_t) (void *, int, size_t);=0A= -=0A= -IMPL (memset, 1)=0A= -IMPL (generic_memset, 0)=0A= -=0A= -#else=0A= -static void=0A= -memset_zero (void * s, size_t len)=0A= -{=0A= - memset (s, '\0', len);=0A= -}=0A= -=0A= -typedef void (*proto_t) (void *, size_t);=0A= -=0A= -IMPL (bzero, 1)=0A= -IMPL (memset_zero, 0)=0A= -#endif=0A= -=0A= -static void=0A= -do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, CHAR *s_end,=0A= - size_t n)=0A= -{=0A= - size_t i, iters =3D MIN_PAGE_SIZE / n;=0A= - timing_t start, stop, cur;=0A= -=0A= - TIMING_NOW (start);=0A= - for (i =3D 0; i < iters && s <=3D s_end; s_end -=3D n, i++)=0A= -#ifdef DO_MEMSET=0A= - CALL (impl, s, 0, n);=0A= -#else=0A= - CALL (impl, s, n);=0A= -#endif=0A= - TIMING_NOW (stop);=0A= -=0A= - TIMING_DIFF (cur, start, stop);=0A= -=0A= - /* Get time taken per function call. */=0A= - json_element_double (json_ctx, (double) cur / i);=0A= -}=0A= -=0A= -static void=0A= -do_test (json_ctx_t *json_ctx, size_t len)=0A= -{=0A= - json_element_object_begin (json_ctx);=0A= - json_attr_uint (json_ctx, "length", len);=0A= - json_array_begin (json_ctx, "timings");=0A= -=0A= - FOR_EACH_IMPL (impl, 0)=0A= - {=0A= - do_one_test (json_ctx, impl, (CHAR *) buf1,=0A= - (CHAR *) buf1 + MIN_PAGE_SIZE - len, len);=0A= - alloc_bufs ();=0A= - }=0A= -=0A= - json_array_end (json_ctx);=0A= - json_element_object_end (json_ctx);=0A= -}=0A= -=0A= -int=0A= -test_main (void)=0A= -{=0A= - json_ctx_t json_ctx;=0A= - size_t i;=0A= -=0A= - test_init ();=0A= -=0A= - json_init (&json_ctx, 0, stdout);=0A= -=0A= - json_document_begin (&json_ctx);=0A= - json_attr_string (&json_ctx, "timing_type", TIMING_TYPE);=0A= -=0A= - json_attr_object_begin (&json_ctx, "functions");=0A= - json_attr_object_begin (&json_ctx, TEST_NAME);=0A= - json_attr_string (&json_ctx, "bench-variant", "walk");=0A= -=0A= - json_array_begin (&json_ctx, "ifuncs");=0A= - FOR_EACH_IMPL (impl, 0)=0A= - json_element_string (&json_ctx, impl->name);=0A= - json_array_end (&json_ctx);=0A= -=0A= - json_array_begin (&json_ctx, "results");=0A= - for (i =3D 1; i <=3D 64; i++)=0A= - do_test (&json_ctx, i);=0A= -=0A= - for (i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, i);=0A= - do_test (&json_ctx, i + 1);=0A= - }=0A= -=0A= - json_array_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_document_end (&json_ctx);=0A= -=0A= - return ret;=0A= -}=0A= -=0A= -#include =0A= -=0A= -#ifdef DO_MEMSET=0A= -# define libc_hidden_builtin_def(X)=0A= -# define libc_hidden_def(X)=0A= -# define libc_hidden_weak(X)=0A= -# define weak_alias(X,Y)=0A= -# undef MEMSET=0A= -# define MEMSET generic_memset=0A= -# include =0A= -#endif=0A= diff --git a/benchtests/bench-memcpy-walk.c b/benchtests/bench-memcpy-walk.= c=0A= deleted file mode 100644=0A= index 12de8a9e819e02d3c608532640e955688ac8415a..000000000000000000000000000= 0000000000000=0A= --- a/benchtests/bench-memcpy-walk.c=0A= +++ /dev/null=0A= @@ -1,131 +0,0 @@=0A= -/* Measure memcpy function combined throughput for different alignments.= =0A= - Copyright (C) 2017-2023 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -/* This microbenchmark measures the throughput of memcpy for various sizes= from=0A= - 1 byte to 32MiB, doubling every iteration and then misaligning by 0-15= =0A= - bytes. The copies are done from source to destination and then back an= d the=0A= - source walks forward across the array and the destination walks backwar= d by=0A= - one byte each, thus measuring misaligned accesses as well. The idea is= to=0A= - avoid caching effects by copying a different string and far enough from= each=0A= - other, walking in different directions so that we can measure prefetche= r=0A= - efficiency (software or hardware) more closely than with a loop copying= the=0A= - same data over and over, which eventually only gives us L1 cache=0A= - performance. */=0A= -=0A= -#ifndef MEMCPY_RESULT=0A= -# define MEMCPY_RESULT(dst, len) dst=0A= -# define START_SIZE 128=0A= -# define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024)=0A= -# define TEST_MAIN=0A= -# define TEST_NAME "memcpy"=0A= -# define TIMEOUT (20 * 60)=0A= -# include "bench-string.h"=0A= -=0A= -IMPL (memcpy, 1)=0A= -#endif=0A= -=0A= -#include "json-lib.h"=0A= -=0A= -typedef char *(*proto_t) (char *, const char *, size_t);=0A= -=0A= -static void=0A= -do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src,=0A= - size_t len)=0A= -{=0A= - size_t i =3D 0;=0A= - timing_t start, stop, cur;=0A= -=0A= - char *dst_end =3D dst + MIN_PAGE_SIZE - len;=0A= - char *src_end =3D src + MIN_PAGE_SIZE - len;=0A= -=0A= - TIMING_NOW (start);=0A= - /* Copy the entire buffer backwards, LEN at a time. */=0A= - for (; src_end >=3D src && dst_end >=3D dst; src_end -=3D len, dst_end -= =3D len, i++)=0A= - CALL (impl, src_end, dst_end, len);=0A= - TIMING_NOW (stop);=0A= -=0A= - TIMING_DIFF (cur, start, stop);=0A= -=0A= - /* Get time taken per function call. */=0A= - json_element_double (json_ctx, (double) cur / i);=0A= -}=0A= -=0A= -static void=0A= -do_test (json_ctx_t *json_ctx, size_t len, int both_ways)=0A= -{=0A= -=0A= - char *s1, *s2;=0A= - size_t repeats;=0A= - s1 =3D (char *) (buf1);=0A= - s2 =3D (char *) (buf2);=0A= -=0A= - for (repeats =3D both_ways ? 2 : 1; repeats; --repeats)=0A= - {=0A= - json_element_object_begin (json_ctx);=0A= - json_attr_uint (json_ctx, "length", (double) len);=0A= - json_attr_uint (json_ctx, "dst > src", (double) (s2 > s1));=0A= - json_array_begin (json_ctx, "timings");=0A= -=0A= - FOR_EACH_IMPL (impl, 0)=0A= - do_one_test (json_ctx, impl, s2, s1, len);=0A= -=0A= - json_array_end (json_ctx);=0A= - json_element_object_end (json_ctx);=0A= -=0A= - s1 =3D (char *) (buf2);=0A= - s2 =3D (char *) (buf1);=0A= - }=0A= -}=0A= -=0A= -int=0A= -test_main (void)=0A= -{=0A= - json_ctx_t json_ctx;=0A= -=0A= - test_init ();=0A= -=0A= - json_init (&json_ctx, 0, stdout);=0A= -=0A= - json_document_begin (&json_ctx);=0A= - json_attr_string (&json_ctx, "timing_type", TIMING_TYPE);=0A= -=0A= - json_attr_object_begin (&json_ctx, "functions");=0A= - json_attr_object_begin (&json_ctx, "memcpy");=0A= - json_attr_string (&json_ctx, "bench-variant", "walk");=0A= -=0A= - json_array_begin (&json_ctx, "ifuncs");=0A= - FOR_EACH_IMPL (impl, 0)=0A= - json_element_string (&json_ctx, impl->name);=0A= - json_array_end (&json_ctx);=0A= -=0A= - json_array_begin (&json_ctx, "results");=0A= - for (size_t i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, i, 1);=0A= - do_test (&json_ctx, i + 1, 1);=0A= - }=0A= -=0A= - json_array_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_document_end (&json_ctx);=0A= -=0A= - return ret;=0A= -}=0A= -=0A= -#include =0A= diff --git a/benchtests/bench-memmove-walk.c b/benchtests/bench-memmove-wal= k.c=0A= deleted file mode 100644=0A= index c93ada461880f21b898ac244130a80ffe380a269..000000000000000000000000000= 0000000000000=0A= --- a/benchtests/bench-memmove-walk.c=0A= +++ /dev/null=0A= @@ -1,160 +0,0 @@=0A= -/* Measure memmove function combined throughput for different alignments.= =0A= - Copyright (C) 2017-2023 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -/* This microbenchmark measures the throughput of memmove for various size= s from=0A= - 1 byte to 32MiB, doubling every iteration and then misaligning by 0-15= =0A= - bytes. The copies are done from source to destination and then back an= d the=0A= - source walks forward across the array and the destination walks backwar= d by=0A= - one byte each, thus measuring misaligned accesses as well. The idea is= to=0A= - avoid caching effects by copying a different string and far enough from= each=0A= - other, walking in different directions so that we can measure prefetche= r=0A= - efficiency (software or hardware) more closely than with a loop copying= the=0A= - same data over and over, which eventually only gives us L1 cache=0A= - performance. */=0A= -=0A= -#ifndef MEMMOVE_RESULT=0A= -# define MEMMOVE_RESULT(dst, len) dst=0A= -# define START_SIZE 128=0A= -# define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024)=0A= -# define TEST_MAIN=0A= -# define TEST_NAME "memmove"=0A= -# define TIMEOUT (20 * 60)=0A= -# include "bench-string.h"=0A= -=0A= -#define NO_OVERLAP 0=0A= -#define PARTIAL_OVERLAP 1=0A= -#define COMPLETE_OVERLAP 2=0A= -=0A= -IMPL (memmove, 1)=0A= -#endif=0A= -=0A= -#include "json-lib.h"=0A= -=0A= -typedef char *(*proto_t) (char *, const char *, size_t);=0A= -=0A= -static void=0A= -do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src,=0A= - size_t len)=0A= -{=0A= - size_t i =3D 0;=0A= - timing_t start, stop, cur;=0A= -=0A= - char *dst_end =3D dst + MIN_PAGE_SIZE - len;=0A= - char *src_end =3D src + MIN_PAGE_SIZE - len;=0A= -=0A= - TIMING_NOW (start);=0A= - /* Copy the entire buffer backwards, LEN at a time. */=0A= - for (; src_end >=3D src && dst <=3D dst_end; dst +=3D len, src_end -=3D = len, i++)=0A= - CALL (impl, dst, src_end, len);=0A= - TIMING_NOW (stop);=0A= -=0A= - TIMING_DIFF (cur, start, stop);=0A= -=0A= - /* Get time taken per function call. */=0A= - json_element_double (json_ctx, (double) cur / i);=0A= -}=0A= -=0A= -static void=0A= -do_test (json_ctx_t *json_ctx, size_t len, int overlap, int both_ways)=0A= -{=0A= - char *s1, *s2, *tmp;=0A= - size_t repeats;=0A= -=0A= - s1 =3D (char *) (buf1);=0A= - s2 =3D (char *) (buf2);=0A= - if (overlap !=3D NO_OVERLAP)=0A= - s2 =3D s1;=0A= - if (overlap =3D=3D PARTIAL_OVERLAP)=0A= - s2 +=3D len / 2;=0A= -=0A= - for (repeats =3D both_ways ? 2 : 1; repeats; --repeats)=0A= - {=0A= - json_element_object_begin (json_ctx);=0A= - json_attr_uint (json_ctx, "length", (double) len);=0A= - json_attr_string(json_ctx, "overlap",=0A= - overlap =3D=3D NO_OVERLAP ? "none"=0A= - : overlap =3D=3D PARTIAL_OVERLAP ? "partial"=0A= - : "complete");=0A= - json_attr_uint (json_ctx, "dst > src", (double) (s2 > s1));=0A= - json_array_begin (json_ctx, "timings");=0A= -=0A= -=0A= - FOR_EACH_IMPL (impl, 0)=0A= - do_one_test (json_ctx, impl, (char *) buf2, (char *) buf1, len);= =0A= -=0A= - json_array_end (json_ctx);=0A= - json_element_object_end (json_ctx);=0A= -=0A= - tmp =3D s1;=0A= - s1 =3D s2;=0A= - s2 =3D tmp;=0A= - }=0A= -}=0A= -=0A= -int=0A= -test_main (void)=0A= -{=0A= - json_ctx_t json_ctx;=0A= -=0A= - test_init ();=0A= -=0A= - json_init (&json_ctx, 0, stdout);=0A= -=0A= - json_document_begin (&json_ctx);=0A= - json_attr_string (&json_ctx, "timing_type", TIMING_TYPE);=0A= -=0A= - json_attr_object_begin (&json_ctx, "functions");=0A= - json_attr_object_begin (&json_ctx, "memmove");=0A= - json_attr_string (&json_ctx, "bench-variant", "walk");=0A= -=0A= - json_array_begin (&json_ctx, "ifuncs");=0A= - FOR_EACH_IMPL (impl, 0)=0A= - json_element_string (&json_ctx, impl->name);=0A= - json_array_end (&json_ctx);=0A= -=0A= - json_array_begin (&json_ctx, "results");=0A= - /* Non-overlapping buffers. */=0A= - for (size_t i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, i, NO_OVERLAP, 1);=0A= - do_test (&json_ctx, i + 1, NO_OVERLAP, 1);=0A= - }=0A= -=0A= - /* Partially-overlapping buffers. */=0A= - for (size_t i =3D START_SIZE; i <=3D MIN_PAGE_SIZE / 2; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, i, PARTIAL_OVERLAP, 1);=0A= - do_test (&json_ctx, i + 1, PARTIAL_OVERLAP, 1);=0A= - }=0A= -=0A= - /* Complete-overlapping buffers. */=0A= - for (size_t i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, i, COMPLETE_OVERLAP, 0);=0A= - do_test (&json_ctx, i + 1, COMPLETE_OVERLAP, 0);=0A= - }=0A= -=0A= - json_array_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_document_end (&json_ctx);=0A= -=0A= - return ret;=0A= -}=0A= -=0A= -#include =0A= diff --git a/benchtests/bench-memset-walk.c b/benchtests/bench-memset-walk.= c=0A= deleted file mode 100644=0A= index d838b8421730a7b9b916b05f6c01529170b69a8b..000000000000000000000000000= 0000000000000=0A= --- a/benchtests/bench-memset-walk.c=0A= +++ /dev/null=0A= @@ -1,122 +0,0 @@=0A= -/* Measure memset function throughput with large data sizes.=0A= - Copyright (C) 2017-2023 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#define TEST_MAIN=0A= -#define TEST_NAME "memset"=0A= -#define START_SIZE 128=0A= -#define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024)=0A= -#define TIMEOUT (20 * 60)=0A= -#include "bench-string.h"=0A= -=0A= -#include "json-lib.h"=0A= -=0A= -void *generic_memset (void *, int, size_t);=0A= -typedef void *(*proto_t) (void *, int, size_t);=0A= -=0A= -IMPL (MEMSET, 1)=0A= -IMPL (generic_memset, 0)=0A= -=0A= -static void=0A= -do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, CHAR *s_end,=0A= - int c __attribute ((unused)), size_t n)=0A= -{=0A= - size_t i, iters =3D MIN_PAGE_SIZE / n;=0A= - timing_t start, stop, cur;=0A= -=0A= - TIMING_NOW (start);=0A= - for (i =3D 0; i < iters && s <=3D s_end; s_end -=3D n, i++)=0A= - CALL (impl, s, c, n);=0A= - TIMING_NOW (stop);=0A= -=0A= - TIMING_DIFF (cur, start, stop);=0A= -=0A= - /* Get time taken per function call. */=0A= - json_element_double (json_ctx, (double) cur / i);=0A= -}=0A= -=0A= -static void=0A= -do_test (json_ctx_t *json_ctx, int c, size_t len)=0A= -{=0A= - json_element_object_begin (json_ctx);=0A= - json_attr_uint (json_ctx, "length", len);=0A= - json_attr_uint (json_ctx, "char", c);=0A= - json_array_begin (json_ctx, "timings");=0A= -=0A= - FOR_EACH_IMPL (impl, 0)=0A= - {=0A= - do_one_test (json_ctx, impl, (CHAR *) buf1,=0A= - (CHAR *) buf1 + MIN_PAGE_SIZE - len, c, len);=0A= - alloc_bufs ();=0A= - }=0A= -=0A= - json_array_end (json_ctx);=0A= - json_element_object_end (json_ctx);=0A= -}=0A= -=0A= -int=0A= -test_main (void)=0A= -{=0A= - json_ctx_t json_ctx;=0A= - size_t i;=0A= -=0A= - test_init ();=0A= -=0A= - json_init (&json_ctx, 0, stdout);=0A= -=0A= - json_document_begin (&json_ctx);=0A= - json_attr_string (&json_ctx, "timing_type", TIMING_TYPE);=0A= -=0A= - json_attr_object_begin (&json_ctx, "functions");=0A= - json_attr_object_begin (&json_ctx, TEST_NAME);=0A= - json_attr_string (&json_ctx, "bench-variant", "walk");=0A= -=0A= - json_array_begin (&json_ctx, "ifuncs");=0A= - FOR_EACH_IMPL (impl, 0)=0A= - json_element_string (&json_ctx, impl->name);=0A= - json_array_end (&json_ctx);=0A= -=0A= - json_array_begin (&json_ctx, "results");=0A= - for (i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, 65, i);=0A= - do_test (&json_ctx, 65, i + 1);=0A= - }=0A= -=0A= - for (i =3D START_SIZE; i <=3D MIN_PAGE_SIZE; i <<=3D 1)=0A= - {=0A= - do_test (&json_ctx, 0, i);=0A= - do_test (&json_ctx, 0, i + 1);=0A= - }=0A= -=0A= - json_array_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_attr_object_end (&json_ctx);=0A= - json_document_end (&json_ctx);=0A= -=0A= - return ret;=0A= -}=0A= -=0A= -#include =0A= -=0A= -#define libc_hidden_builtin_def(X)=0A= -#define libc_hidden_def(X)=0A= -#define libc_hidden_weak(X)=0A= -#define weak_alias(X,Y)=0A= -#undef MEMSET=0A= -#define MEMSET generic_memset=0A= -#include =0A= diff --git a/benchtests/bench-memset-zero-walk.c b/benchtests/bench-memset-= zero-walk.c=0A= deleted file mode 100644=0A= index 53d7d712b9976cc8da437bbe0c21cc2d266595a7..000000000000000000000000000= 0000000000000=0A= --- a/benchtests/bench-memset-zero-walk.c=0A= +++ /dev/null=0A= @@ -1,20 +0,0 @@=0A= -/* Measure memset functions for zeroing throughput with large data sizes.= =0A= - Copyright (C) 2022-2023 Free Software Foundation, Inc.=0A= - This file is part of the GNU C Library.=0A= -=0A= - The GNU C Library is free software; you can redistribute it and/or=0A= - modify it under the terms of the GNU Lesser General Public=0A= - License as published by the Free Software Foundation; either=0A= - version 2.1 of the License, or (at your option) any later version.=0A= -=0A= - The GNU C Library is distributed in the hope that it will be useful,=0A= - but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU=0A= - Lesser General Public License for more details.=0A= -=0A= - You should have received a copy of the GNU Lesser General Public=0A= - License along with the GNU C Library; if not, see=0A= - . */=0A= -=0A= -#define DO_MEMSET 1=0A= -#include "bench-bzero-walk.c"=0A= =0A=