From patchwork Tue Jul 30 14:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1966556 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=C8rthJYB; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=C8rthJYB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYH4t1XWnz1ybX for ; Wed, 31 Jul 2024 00:03:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C34B3858414 for ; Tue, 30 Jul 2024 14:03:24 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) by sourceware.org (Postfix) with ESMTPS id 75A1E385DC1B for ; Tue, 30 Jul 2024 14:02:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75A1E385DC1B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 75A1E385DC1B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.40 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722348185; cv=pass; b=EFdIfuSLdthmhCzvZnej0Bni+aMg4QRr/IOqunGVHmHHyN9s577qIaOf7c+MuZakHWOKhZuyzpqd889KTKTXT78S2evsoGEfIqhGNo91BQLYMYRq0Fs8ECxGXlKJUdmpHtOu6WTYjxyHqeuHgnoZ9RvLPOvXXR2Q8A/sBYHlqoE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722348185; c=relaxed/simple; bh=Rq0H0gBR8YUfgdSrG1gQZ1cjBk96AYQLi3LpFTeeYkM=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=eCRLDt+94RCzLyybvKpFpmR2b4QncFGcsI5F3TopPOgVI+s2flY9AaiBqJY81AvFcbHnmoTUSnRmskmuv09ORCTlm8sDUufbxwCyknu/lrWf8lYDRgE9q7ITQqT8sV5Ig5cd+3zwMh/6Qt4ON51A41UTJ8jm4lPiuEPSgaxXxn0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=BTBmZAG9AUBhy/eqLTMVAlEwqVGfs0LwbWvt/64hjaal89N0k4pgQRLbFpda8PbmpY6x6vSCo+PADryg7ZG8i7imsaat1a0H0Ge5P2R2BPVuaJyYOuYsqwDXeWRHcxaLyshuj4M9GEQgP1WCWOuEnIUMSgMZiNbnEipzLjN5afMWKuKcUTTnkimG3gdnKmXUxDNSPdcwssTQdQCCAyQl4kM4w1l+MM1DmuvvbODVi+8/tPNhW2oqZoHOQCe/4Du2lW+p19Mb5j1AGShHZJDUfEgdhVkOs14WyN2XXCgOGkfx/DwX59RjI0ZkCXCxuWcAB7A1riFGhw9m69yn6kFkfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5qjzOpPb/gu4Biv4immaKZKcy0KPxCfq0tTdyj1u7iY=; b=rZHh45+UXoqoVXEDJ2FC7h3mRoNruwmQuBC8GjdcSEej7CjfA80X3Yb8uYoGRP2GxUF7S9LwSo9lsVq5jSNprqFYyGOlMOe9KYWphbGsUmpxeI9Q2nqEJyGTiyni1sPeFDaCdDiXiGi4cJGYhtYj6+izHl1rCqR2bhFg6kD+ISI3s6XaismG5uvz0NB+e+i0m1moVtutukc62hoIDEQKXVjSXT0U/Pnsrus2miQDZCUzYR3oBye9guvUiQQhckjevWXgRnD/dqHKas/m5OoXh5WKGJlUYPUALHcaOhG5rvv0s7MSFrygb0zlnIbfAIZhFVDShqEBLQafVpnjrF6Tew== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5qjzOpPb/gu4Biv4immaKZKcy0KPxCfq0tTdyj1u7iY=; b=C8rthJYBkJX2IGEP1B+8qb2xLBAd00ay+NZ3WnE/lNhHtv82xl7s0CJmr4sAnq1VteKG3PSmR2aEKEBf/9bw7ojXxtZE4mMZ/xB34eCUH+JeJiZkhvApFTOj+iUxsbuRB5B2/ttSUa45dV7qnGiwQbbwZN6vsJq3iSbeBkBMX4g= Received: from DUZPR01CA0004.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::20) by PA4PR08MB7521.eurprd08.prod.outlook.com (2603:10a6:102:26a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 14:02:47 +0000 Received: from DU6PEPF0000B61F.eurprd02.prod.outlook.com (2603:10a6:10:3c3:cafe::c9) by DUZPR01CA0004.outlook.office365.com (2603:10a6:10:3c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Tue, 30 Jul 2024 14:02:47 +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=arm.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 DU6PEPF0000B61F.mail.protection.outlook.com (10.167.8.134) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:02:47 +0000 Received: ("Tessian outbound ca5638866b89:v365"); Tue, 30 Jul 2024 14:02:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d13d567ac329c68e X-CR-MTA-TID: 64aa7808 Received: from L0f96889c738f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8BC16087-741C-4CCD-8399-F95B985B516C.1; Tue, 30 Jul 2024 14:02:40 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L0f96889c738f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 30 Jul 2024 14:02:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oelONyeen3RUEGI7nVRMEKW/SL8sI3Hax42NEGa1NITs7boUGAP91SUCzwADxcsM9mD6H1Bd5IBTOCNAvoyA+E6a7cw11lGcLEqqA1NUT4VQiJ7vzR155YK6q+fbd/TixGeSD0OfGVgEeAEMZPxP3/ISz+cRHmOKCMiXd8k0sqUhGFURUz5E/UQXYNy/skqRMsTM14toLDAI/KTKyWwMEoyXme4d4/Tk1MbxYyIh0nRmsmCVCQoVQVGM9aQ/SnyRLERNH2bs53o1NXxcyDnWSaXCCA5s6FytCItkMwUTg3gY4ZV1Jc6h3mIt1p26KDA+Ri8PNU7rjFOxBcwfhc3tkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5qjzOpPb/gu4Biv4immaKZKcy0KPxCfq0tTdyj1u7iY=; b=y91Am7hNTDyIx1Hev22F9Pe0tIkAJ/YnLaMr3LZMc8W5TqbZkBjwGAbnn9XDMroJGTBtxQeJ8tm7w5Oyt7MumNVgI4QDkVDm1EnjgxuvqTHld986795scsG4FfKHNwCFOocH1uCjov9yE84Hdxy9EwBlQv3uBky3/E8/aCHjqZI7Y+SWSYLRPR8OQB4Dwf+kYoAT2Z7JJyth4Mr9rjTlaC1Mg/dabl7BfYEVeeRIJsKht2uD7s6QNhEM1q6TsswY3LdIn0rkitLDIjuQEEZ2Vwgy7TYeliE+LmRJXJqDzBsDseOIGd56Q++wJpJbh3Q+o+a9Ru9WYNhCt278XsvXSw== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5qjzOpPb/gu4Biv4immaKZKcy0KPxCfq0tTdyj1u7iY=; b=C8rthJYBkJX2IGEP1B+8qb2xLBAd00ay+NZ3WnE/lNhHtv82xl7s0CJmr4sAnq1VteKG3PSmR2aEKEBf/9bw7ojXxtZE4mMZ/xB34eCUH+JeJiZkhvApFTOj+iUxsbuRB5B2/ttSUa45dV7qnGiwQbbwZN6vsJq3iSbeBkBMX4g= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PR3PR08MB5721.eurprd08.prod.outlook.com (2603:10a6:102:84::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 14:02:37 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d%6]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 14:02:37 +0000 From: Wilco Dijkstra To: 'GNU C Library' Subject: [PATCH] benchtests: Add random strlen benchmark Thread-Topic: [PATCH] benchtests: Add random strlen benchmark Thread-Index: AQHa4ohRQoUcqFK9s0iEzKuhNHgupg== Date: Tue, 30 Jul 2024 14:02:37 +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_|PR3PR08MB5721:EE_|DU6PEPF0000B61F:EE_|PA4PR08MB7521:EE_ X-MS-Office365-Filtering-Correlation-Id: 29c00687-ee31-431f-f57b-08dcb0a04abf x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; X-Microsoft-Antispam-Message-Info-Original: =?iso-8859-1?q?o6EGmsSMStoHTWZiG?= =?iso-8859-1?q?K7pETKDcOmlC4YuaUgeuZyj6BVAktD8dnAi9MtC+owpPcDqLZ7chXRwIVuD1?= =?iso-8859-1?q?/KtyMmWkngTXse48f0ci0rVpYLkIc3W6O9KKDjmWRzJKQrIItzWaPmHyGxO8?= =?iso-8859-1?q?X4ZJgb2caRgv1GeBA0LOMhHSOYFYAf7r4RIG07LJP1mthLp1zMKc5Y6WVsRh?= =?iso-8859-1?q?EpXTejnsASBedIPugdsf+PpoHQJ3ZVENiBeSao5X/oVXIDrlsAuq8tSmbs8o?= =?iso-8859-1?q?kKIqgINM0nVEhcPVASL4E7b2v6KOwy2yb57QFfkBFXwpnOMIf/diOzFy16wD?= =?iso-8859-1?q?I/CLFKbZoDpqx/I32Up5hUopJEHuN9d+7u4N/+VyM6IizAdILM0t/TrKRzFz?= =?iso-8859-1?q?t0xuA/rNl8foOTQd7psUFOEbipwQfT1flHRwkNl4F5bA3HpW+n6cbWlzHUM0?= =?iso-8859-1?q?44slJ3u2O+YwbhuhpQ01uTVhYzze0xf8rSeBhhC7Miy20sNxpOndER9+j77t?= =?iso-8859-1?q?Yl/WUJQSK9mcfCbm1ax/BsFlu1JK5IGfGHOyWp+w8vDlflfgCxNZqIt//Vwg?= =?iso-8859-1?q?pK4XvcRAIBIsaRrxCn++B3+VG9MmSOtpjSFZ5C5n8ZWIioroLG1kmzfPRncr?= =?iso-8859-1?q?D4oAk70Ola2PQ8LQS7XdCZArcNLEaj/6PQSdwgZEm+wPf1AuFnvlwCoemAT1?= =?iso-8859-1?q?7WD2pIfmx/OoSxOuzZNkRsZHRFQOpkoP58ZTMJwMR8dBEC+nRrqWLvoO4urq?= =?iso-8859-1?q?7Eyn3esBteOTvGKXV4fk290ofZGWmpLolQalXGJhBcNUhgSc+97W7oyBYWdx?= =?iso-8859-1?q?SmOxLvW8sE6rw8havgqOsIG/jSAwxoM2yiXC37u8wW8iOSz/FwOx6uhrzV+w?= =?iso-8859-1?q?ByijzryVXD/f6sA+wzHz4w/+KNbE1Mzo6I9jdN7BqTsU6hEbwd+vsjCQQrYD?= =?iso-8859-1?q?Why//ERYgbvra6MvCpSLHITZOg1DrEL2mmwpAzwMZl/Fq7QXOftwZiPHTeTd?= =?iso-8859-1?q?vHBngE6woPMqspYlnSoLaHuif5LWP6yb9MwQVecVKGUZdvhB5x4OAsC1qXI5?= =?iso-8859-1?q?q176MppiX7T2b4ia9VDEEqXP5hZqSmQKXCeL/EJNVXvt5NLHEzEF9D7C6TsX?= =?iso-8859-1?q?Km9t13+zndIfhh+bBLYAYxvtY/T4xJlayj1TSnjludxRlXnXFd15JlfArcgL?= =?iso-8859-1?q?FHf1ZLH3/k/5bo/wrXaus8qeWzzzB+INjDU7pn0G7npiw/jDWfM2+Q7jHx3T?= =?iso-8859-1?q?iOBSvrluj0qr6uNEjiFOBy8iRnCD/uDgTav20Elbs1QvOyi5XBenfvitXaQy?= =?iso-8859-1?q?d5jFEOEX4GIsQdarxH2O4pYUHHR1TIfPrDyfqtlKxG4Twlg39VPoxnXeksu4?= =?iso-8859-1?q?UCr1fIXGi1SIJJeOaF6ZZ4MakzO0ysDYK7GZRl1w++loYLmGVc=3D?= 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:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5721 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-SkipListedInternetSender: ip=[2603:10a6:102:33f::20]; domain=PAWPR08MB8982.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e42d6a7e-5d03-4c48-c2d7-08dcb0a044a7 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|35042699022|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?7D/jwlkL00orD8UznMFaeZ96bh?= =?iso-8859-1?q?Y+9KZZElGzFQDHWL5BB8H2c+DenNNCKULuHK73CQ02UkFGlVF72DK4daVFSP?= =?iso-8859-1?q?WnvjytCtdNbuInseNO8pH9VdOhNtfgz/LD34snP/lnnuE4kVMkk4zHTaDEZT?= =?iso-8859-1?q?jOW8KZATYWqRVqM5GQmZ+zm4wHXQ/zYZuyDoeRQTJeRRfYbDEoVlxlJx83Jx?= =?iso-8859-1?q?LOExDyF2aqLhoCH+KAkaXsbWlLxNA6y1noXNyNAwTnGAZVaMMBA3q1r5jKkj?= =?iso-8859-1?q?qGsoAXzsNCNk/A/dKEoossWDWSiAAxT/nkJ4XvmrhJlC87TfrrX+OuZX50sk?= =?iso-8859-1?q?f3nvi9/fs+EuTJi5lYsrgiE2+ajE6WUEORmjowuqV749sWWFOejICELiasGK?= =?iso-8859-1?q?oDLdNwxlHXJupXyOEnl3ZKTiH1WaNn2p4ElrNy9YvDVCxA/r6BYvtyZZTPO7?= =?iso-8859-1?q?ES0jPOwjJvTorsZr6xIceXc6HEa8J4MYQfl9cn/burMjquNfW1MEDcIkvweF?= =?iso-8859-1?q?S7XYmXl8OKl5WqcKtdN3Bdtr4DQF6elRzzr83TZXdyaT9BHfBaWP7P7OMU5P?= =?iso-8859-1?q?wYCntwnqHE5hFTbeo6tiPD2RwMM9t3WVT79ihg1AO6yiFg4N2u+/whwAcv+p?= =?iso-8859-1?q?tVTvfCjFpMp4cwf+URTrVk6jtSgEpOyYeUZ2EamEscKwIaDPUALa7BYg0i0R?= =?iso-8859-1?q?bncBimbj+lfOpMkcuCR01yHPkt+DiKEDNBx1cGBWj9iO8whgkRkpQRxdXOro?= =?iso-8859-1?q?0TBjPwTcen3f2wTeessBsTSYdu4/RAtXIP9c3Iyb2LjskJcUD2VBsXcXpQhw?= =?iso-8859-1?q?XZntGgEDKFuWMn4U73Ub91v1u6jFf+72Yu8BelIi5yhFxjYkz4h1vG6jg98S?= =?iso-8859-1?q?ih73CqMRukdAiY2RnnL/kz8t3JjO6SLF9BUjb48eMv/wWYKG+S5bhIZAs38R?= =?iso-8859-1?q?nAPMckX/Md5nPLP2Z2NEresnea/Gfs/AdLlIlVthSeHCLtvs/Vy3Prpp2v30?= =?iso-8859-1?q?55fFH7JXb2xGyU808Fpfp2aF13Qhvk8IWiumu9pSbvSk2IcHB8/8oyvIIBFZ?= =?iso-8859-1?q?Demf8KO9ye2R+CACaX2llQKMZUCtAZFEYe1T0iUddHrZ/SGTFISaNUY3ki9p?= =?iso-8859-1?q?bLxWZd0kylIIM9A214Io64vG+qj458z95qRXUwz4Xp5hRbLhOySyPIouN1NS?= =?iso-8859-1?q?YnXabDUuOofCsYhv8oR36ag0tqI8GwZcMhUfCpHHlqEIxWPLYFNnz/RwvWqN?= =?iso-8859-1?q?qJZb8RJSIRj1091mLoXSEIs7cwrRMARtFwfj5BXIPGECOod4kDkR/JNmWtgc?= =?iso-8859-1?q?CLjIqcrOI6G2q7PJg3HZe9p+WByc66fyaV/85XX6bVP6HNW9iP4teqw7VzgA?= =?iso-8859-1?q?cK+v+8qrvBJqfBwbxUhVXUe1ksFr4sA5nazsPs7oKEfc6YXUqfac4DuF3xG0?= =?iso-8859-1?q?z3m+qwBBAWyjzqmb08LUd1cw=3D=3D?= 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:(13230040)(82310400026)(35042699022)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 14:02:47.5117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29c00687-ee31-431f-f57b-08dcb0a04abf 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: DU6PEPF0000B61F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7521 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org 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. diff --git a/benchtests/Makefile b/benchtests/Makefile index d228e9e68af3d73129591f3d875d6be545182eac..6d746ad2d4de78470b1f7936c34affbd6edb254a 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -171,6 +171,7 @@ string-benchset := \ strcpy_chk \ strcspn \ strlen \ + strlen-random \ strncasecmp \ strncat \ strncmp \ diff --git a/benchtests/bench-strlen-random.c b/benchtests/bench-strlen-random.c new file mode 100644 index 0000000000000000000000000000000000000000..becd09a2caff40262127b732aadd7d0e4374e9aa --- /dev/null +++ b/benchtests/bench-strlen-random.c @@ -0,0 +1,194 @@ +/* Measure strlen performance. + Copyright (C) 2024 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 + . */ + +#define TEST_MAIN +#define TEST_NAME "strlen" + +#define NUM_TESTS 65536 +#define MAX_ALIGN 32 +#define MAX_STRLEN 128 +#define MIN_PAGE_SIZE (2 * getpagesize()) + +#include "bench-string.h" +#include +#include "json-lib.h" + +typedef size_t (*proto_t) (const CHAR *); + +size_t memchr_strlen (const CHAR *); + +IMPL (memchr_strlen, 0) + +size_t +memchr_strlen (const CHAR *p) +{ + return (const CHAR *)MEMCHR (p, 0, PTRDIFF_MAX) - p; +} + +IMPL (STRLEN, 1) + +static uint32_t strlen_tests[NUM_TESTS]; + +typedef struct { uint16_t size; uint16_t freq; } freq_data_t; +typedef struct { uint16_t align; uint16_t freq; } align_data_t; + +#define SIZE_NUM 65536 +#define SIZE_MASK (SIZE_NUM-1) +static uint8_t strlen_len_arr[SIZE_NUM]; + +/* Frequency data for strlen sizes up to 256 based on SPEC2017. */ +static freq_data_t strlen_len_freq[] = +{ + { 12,22671}, { 18,12834}, { 13, 9555}, { 6, 6348}, { 17, 6095}, { 11, 2115}, + { 10, 1335}, { 7, 814}, { 2, 646}, { 9, 483}, { 8, 471}, { 16, 418}, + { 4, 390}, { 1, 388}, { 5, 233}, { 3, 204}, { 0, 79}, { 14, 79}, + { 15, 69}, { 26, 36}, { 22, 35}, { 31, 24}, { 32, 24}, { 19, 21}, + { 25, 17}, { 28, 15}, { 21, 14}, { 33, 14}, { 20, 13}, { 24, 9}, + { 29, 9}, { 30, 9}, { 23, 7}, { 34, 7}, { 27, 6}, { 44, 5}, + { 42, 4}, { 45, 3}, { 47, 3}, { 40, 2}, { 41, 2}, { 43, 2}, + { 58, 2}, { 78, 2}, { 36, 2}, { 48, 1}, { 52, 1}, { 60, 1}, + { 64, 1}, { 56, 1}, { 76, 1}, { 68, 1}, { 80, 1}, { 84, 1}, + { 72, 1}, { 86, 1}, { 35, 1}, { 39, 1}, { 50, 1}, { 38, 1}, + { 37, 1}, { 46, 1}, { 98, 1}, {102, 1}, {128, 1}, { 51, 1}, + {107, 1}, { 0, 0} +}; + +#define ALIGN_NUM 1024 +#define ALIGN_MASK (ALIGN_NUM-1) +static uint8_t strlen_align_arr[ALIGN_NUM]; + +/* Alignment data for strlen based on SPEC2017. */ +static align_data_t string_align_freq[] = +{ + {8, 470}, {32, 427}, {16, 99}, {1, 19}, {2, 6}, {4, 3}, {0, 0} +}; + +static void +init_strlen_distribution (void) +{ + int i, j, freq, size, n; + + for (n = i = 0; (freq = strlen_len_freq[i].freq) != 0; i++) + for (j = 0, size = strlen_len_freq[i].size; j < freq; j++) + strlen_len_arr[n++] = size; + assert (n == SIZE_NUM); + + for (n = i = 0; (freq = string_align_freq[i].freq) != 0; i++) + for (j = 0, size = string_align_freq[i].align; j < freq; j++) + strlen_align_arr[n++] = size; + assert (n == ALIGN_NUM); +} + +static volatile size_t maskv = 0; + +static void +do_one_test (json_ctx_t *json_ctx, impl_t *impl, size_t iters, + uint32_t *input, size_t n) +{ + timing_t start, stop, cur; + size_t res = 0; + size_t mask = maskv; + + /* Avoid 'cold start' performance penalty. */ + for (int i = 0; i < 10; i++) + for (int j = 0; j < n; j++) + CALL (impl, (const char*)buf1 + input[j]); + + TIMING_NOW (start); + for (int i = 0; i < iters; ++i) + for (int j = 0; j < n; j++) + res = CALL (impl, (const char*)buf1 + input[j] + (res & mask)); + TIMING_NOW (stop); + TIMING_DIFF (cur, start, stop); + json_element_double (json_ctx, (double) cur / (double) iters); +} + +static void +do_test (json_ctx_t *json_ctx) +{ + size_t n; + uint8_t *a = buf1; + uint16_t index[MAX_ALIGN]; + + memset (a, 'x', MIN_PAGE_SIZE); + + /* Create indices for strings at all alignments. */ + for (int i = 0; i < MAX_ALIGN; i++) + { + index[i] = i * (MAX_STRLEN + 1); + a[index[i] + MAX_STRLEN] = 0; + } + + /* Create a random set of strlen input strings using the string length + and alignment distributions. */ + for (n = 0; n < NUM_TESTS; n++) + { + int align = strlen_align_arr[rand () & ALIGN_MASK]; + int exp_len = strlen_len_arr[rand () & SIZE_MASK]; + + strlen_tests[n] = + index[(align + exp_len) & (MAX_ALIGN - 1)] + MAX_STRLEN - exp_len; + assert ((strlen_tests[n] & (align - 1)) == 0); + assert (strlen ((char*) a + strlen_tests[n]) == exp_len); + } + + json_element_object_begin (json_ctx); + json_array_begin (json_ctx, "timings"); + + FOR_EACH_IMPL (impl, 0) + do_one_test (json_ctx, impl, INNER_LOOP_ITERS_MEDIUM, strlen_tests, n); + + json_array_end (json_ctx); + json_element_object_end (json_ctx); +} + +int +test_main (void) +{ + + json_ctx_t json_ctx; + + test_init (); + init_strlen_distribution (); + + json_init (&json_ctx, 0, stdout); + + json_document_begin (&json_ctx); + json_attr_string (&json_ctx, "timing_type", TIMING_TYPE); + + json_attr_object_begin (&json_ctx, "functions"); + json_attr_object_begin (&json_ctx, TEST_NAME); + json_attr_string (&json_ctx, "bench-variant", "random"); + + json_array_begin (&json_ctx, "ifuncs"); + FOR_EACH_IMPL (impl, 0) + json_element_string (&json_ctx, impl->name); + json_array_end (&json_ctx); + + json_array_begin (&json_ctx, "results"); + do_test (&json_ctx); + + json_array_end (&json_ctx); + json_attr_object_end (&json_ctx); + json_attr_object_end (&json_ctx); + json_document_end (&json_ctx); + + return ret; +} + +#include