From patchwork Wed Mar 8 10:50:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 66121 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C111F3858C54 for ; Wed, 8 Mar 2023 10:51:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C111F3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678272682; bh=W42HJHPOQ25genRfuJjBVyqCs2G+W9DSntBRLkVA2jQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Yt9IRRuykCI4FU69tj85pfBJuQaYwPd09EnKtHFbLzEkDX/qfW+O8dYxPB8XibVlg QXlT53jjQLO5+PZar6E68zZA5+GDKgxc7FhPOpjFIt8A1Ma2kruBetzlixdkiLOdWt MiWISlsWLD4uwAkrJIvx8kJ/6LEUWZtqsDlvEMdg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::611]) by sourceware.org (Postfix) with ESMTPS id B63803858C54 for ; Wed, 8 Mar 2023 10:50:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B63803858C54 Received: from ZR0P278CA0095.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::10) by AS4PR08MB7578.eurprd08.prod.outlook.com (2603:10a6:20b:4fd::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 10:50:57 +0000 Received: from VI1EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:23:cafe::a8) by ZR0P278CA0095.outlook.office365.com (2603:10a6:910:23::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Wed, 8 Mar 2023 10:50:57 +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 VI1EUR03FT027.mail.protection.outlook.com (100.127.144.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Wed, 8 Mar 2023 10:50:57 +0000 Received: ("Tessian outbound f2a8d6d66d12:v135"); Wed, 08 Mar 2023 10:50:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c3e2460902330fa2 X-CR-MTA-TID: 64aa7808 Received: from 4fccd6e78845.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F331771-E3D7-474E-BD9B-569B033AA749.1; Wed, 08 Mar 2023 10:50:50 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4fccd6e78845.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Mar 2023 10:50:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ISZ5dcPL/AkyLbJdgAeKmYt2WuWP9EXgFqtvH02NUpNXvWU6zlQFneAC3AAC1P8StF/mgyjQQaA0b1hMAQGWL8wBcD7pUxT9gnxmbJvkMiuwNBtDXkhqtLhZOBsGm0NOdfNLxBKy+koEHPbzdUntwh6Mp5TKUOJv10KvTifscNm19RkNgui5wutvVCo3/4nmQuzgEeWd0b2mUSZkEVyaUiKOcyyjCuZG+juQleCfNKq8T3u3Ah1BhDuebbIExzMbCQlxJB+UYwnJ0I4iXHg/cIbNvcOh44u672kDe/lzZqLudIJGOgP7zYlICgBKW7Im/F+aXEhNYzIRKmkscW6iQQ== 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=W42HJHPOQ25genRfuJjBVyqCs2G+W9DSntBRLkVA2jQ=; b=jY2xvpE1GdVmGHyLQDVp8Sx1gmJqbwoKQ7Eh/tQ7XkOXktN0A84I7fT0IStiptT9DGw3Nzj3hViFYI8PQvExl1Uao+IY3gfBvOXJgAiVf9YP4NmRZcAMOtdf56DyE/pG06MNXvdGq9DzwvU6XJ9Tz7J39MWujjPLLFlOkOvbmI2BNDi4Wwx0iYH4oeWehkR01DIk79tIpb/lwCyyWClLDIP5MKAdd8k0Jhfic+fPHnh/SVb8xWmSwSNBsYlT98X3PURhpYgH8DlNxZQQPon3gx7m00JT4f/J59uU/cs6Aau/VU243fKSQa/QYN7u5XH+iaqE6FOAazesGmjSeRMGNQ== 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 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AM9PR08MB5922.eurprd08.prod.outlook.com (2603:10a6:20b:2dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 10:50:46 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573%7]) with mapi id 15.20.6156.025; Wed, 8 Mar 2023 10:50:46 +0000 To: 'GNU C Library' Subject: [PATCH] Benchtests: Remove memchr_strnlen Thread-Topic: [PATCH] Benchtests: Remove memchr_strnlen Thread-Index: AQHZUat4sleKhqLUEkaWdjKywMIOzg== Date: Wed, 8 Mar 2023 10:50:46 +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_|AM9PR08MB5922:EE_|VI1EUR03FT027:EE_|AS4PR08MB7578:EE_ X-MS-Office365-Filtering-Correlation-Id: cf3c8c8a-a44c-49e6-3fa7-08db1fc2ff62 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: S3LHwky3izNISbAlqW8IQ4Re91QQtZ5ZxBEctfDPug1XNI3KETp1h9QOAaxO9LzpQchrbwbunu/8Qg8Xs/Ly3NnC0iaglLH6HNFXImKFRchpF8hrm2UGY6NFM+ibt0ZZkcWlDGpnhOCJWm7TX8dixMcxDFXVVmOKeFaGiZThIu3wz+4i1oNz5bbXKZaeeR9TeiMXfgmE67qW06DwxGeHIjx9AwYUyu9fxPoii4Nsv8Z08E+9rcaSSgc/nPzrooCYIbya6iYm3jUpe1vaWE1lAUhrAUs1vqvPmun5KIAw0dB49Yofs9jZq5QtPjJj/v4YaQX6c4EHuOTe62rDZ8+guYL5GX9mERHrGkW0SkCiVo9PhcP5Wad5aBIvI6SPdtdsNHlTL4jDJ/9fWp/Ym4M39GCU41qgyqhqQ1xcM0Wkh1qqhv8n9Na82GAIV67vh0SlcYsFcAV6An1bzwCyNmycpzRGZCba6s7DteGRnNsqGmvzWR3heGL5T6Pw8XsmdcVMqwV9Gzzn186I/Robt9Hynt2gC7aOGNbB3snRszJLoFv6O+VZfAU2NXiOuSJ25Kaen3cH9xm5Rgh3EfLrCCzaOm2YW8PWjYcYU1V+ZmCVNwjN6kPniX7493DqAqUNT9b1fzGm2+LDK8y3Hhk2Fj7UL4eWEnHyJrt61ADN9Pt/U+IPNAHE0XK/LCJy6ezQNHkH5FfmWej2rTHsfRnMByRkFA== 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)(39860400002)(346002)(136003)(376002)(396003)(366004)(451199018)(33656002)(478600001)(55016003)(91956017)(122000001)(38070700005)(316002)(38100700002)(71200400001)(7696005)(6506007)(9686003)(41300700001)(186003)(26005)(5660300002)(66556008)(66476007)(52536014)(66946007)(76116006)(8936002)(6916009)(66446008)(2906002)(86362001)(8676002)(64756008); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5922 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: VI1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5b334b4a-bddf-48cd-c3d9-08db1fc2f915 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j19527Fh5nwjo7TO77Kmgy55UbTD8SytfnggVTtxSKRTqK0ROc5RgEUCEgRVF5tFc9YC+4TOVh7bVqTZY8DLPsOegt5CGBEHSAn/R9vuBobxva9MWhhGTqrkm9cLeb6zYurnFMBHjFPZNKSqMqSxb1tQM+aAVa/ALDoin3QqwMnLNjrundkAbLaTryjyLEDatbyP3NyhmW4W0AwVxZx0SUbIRVcUYW7ZnSpl6Nr3wLPDlsHS0LZa38TZR3dNKvQ4ZBKLY50xvdZQOgww8fTGMADwObqZlFedLs3inbpCo527y6+6YW6dAE/+l/yFyhmHQkZuwoQGgtHeTGvIP4ezZxZv7cVeOvGGt9Aza3npiEb/sniFhkld17ZuRft/ayscaW9DkcYKLhpb7qq4ABjehp1fRZZi7ZUWYoKn4xZ5Smj3s8vvoNSy0Eb6eArka5+YP4uGGC5p/JX6E4tkwPmRLzLShBBtUswRfMwdyYL7Y3D6XE9omjYj+kMMmZzSBC52RSUFhslXm4qLPnh9xLcgVW6nPuaqQcB7usdGAjZ7ZRH7T21JLgRWimaGV5TN9p4Kbm5dm+31ibODwqDdkfhHL4kANYKs0vtOJJvKrvDnqvf0PfoUn/r1XXfVVTe/C+LoCHqZgoELdvlZgkjhLRgVN1gp38Taq4Htsn7bokkQZNvWIFzU0jZzuPCL4pOzpm37382YamsmReq74EqqFQ57zg== 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)(39860400002)(346002)(396003)(136003)(376002)(451199018)(46966006)(40470700004)(36840700001)(81166007)(70586007)(6916009)(70206006)(41300700001)(8676002)(82740400003)(316002)(8936002)(52536014)(5660300002)(478600001)(82310400005)(36860700001)(2906002)(40460700003)(356005)(55016003)(7696005)(40480700001)(33656002)(6506007)(9686003)(186003)(26005)(47076005)(86362001)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 10:50:57.0708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf3c8c8a-a44c-49e6-3fa7-08db1fc2ff62 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: VI1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7578 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wilco Dijkstra via Libc-alpha From: Wilco Dijkstra Reply-To: Wilco Dijkstra Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Remove memchr_strnlen since it is now the same as generic_strnlen. Adjust iteration count to reduce benchmark time. (I kept memchr_strlen since the generic strlen does not use memchr). Reviewed-by: Adhemerval Zanella diff --git a/benchtests/bench-strlen.c b/benchtests/bench-strlen.c index cae88dd6ec1794709fdf36a373896dd2d9d285dd..9b91f8a10ef0621cf2bc8310d8f08bd978b6d898 100644 --- a/benchtests/bench-strlen.c +++ b/benchtests/bench-strlen.c @@ -48,7 +48,7 @@ IMPL (STRLEN, 1) static void do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, size_t exp_len) { - size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS_LARGE; + size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS8; timing_t start, stop, cur; if (len != exp_len) diff --git a/benchtests/bench-strnlen.c b/benchtests/bench-strnlen.c index c997d7da4c93b08070b718ef22cbd5582feeca09..a1840afa85c52dfecd35b1e4bb36d339b0866483 100644 --- a/benchtests/bench-strnlen.c +++ b/benchtests/bench-strnlen.c @@ -22,7 +22,6 @@ #else # define TEST_NAME "wcsnlen" # define generic_strnlen generic_wcsnlen -# define memchr_strnlen wcschr_wcsnlen #endif /* WIDE */ #include "bench-string.h" #include "json-lib.h" @@ -38,22 +37,14 @@ typedef size_t (*proto_t) (const CHAR *, size_t); size_t generic_strnlen (const CHAR *, size_t); -size_t -memchr_strnlen (const CHAR *s, size_t maxlen) -{ - const CHAR *s1 = MEMCHR (s, 0, maxlen); - return (s1 == NULL) ? maxlen : s1 - s; -} - IMPL (STRNLEN, 1) -IMPL (memchr_strnlen, 0) IMPL (generic_strnlen, 0) static void do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, size_t maxlen, size_t exp_len) { - size_t len = CALL (impl, s, maxlen), i, iters = INNER_LOOP_ITERS_LARGE; + size_t len = CALL (impl, s, maxlen), i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; if (len != exp_len)