From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6A3E51F8C6 for ; Tue, 24 Aug 2021 17:10:49 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 626AF3857415 for ; Tue, 24 Aug 2021 17:10:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 626AF3857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629825048; bh=/G/FbCWvYwuf3wbFAjBDS1DbzhW0KWANEVjq8hJUWk0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=yqoEKfABPRoedpPFgM6uBfQzEVQszL7oTQOrbVBsjy1CrJF6V/5nfz59RK7t4BWJ5 x9+WABYRteMUK7BnkdnaCqjnQqZY8DaPaKlT01aLKQDTYvXJRgCeU6VRAkLThheUCg RfFtlxPFoDE6X9EknYdiG4trCWKdRYUw7gWd41Cs= Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by sourceware.org (Postfix) with ESMTPS id 9A8B73858437 for ; Tue, 24 Aug 2021 17:09:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A8B73858437 Received: from DB6PR0201CA0034.eurprd02.prod.outlook.com (2603:10a6:4:3f::44) by DB9PR08MB6570.eurprd08.prod.outlook.com (2603:10a6:10:251::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 17:09:23 +0000 Received: from DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::89) by DB6PR0201CA0034.outlook.office365.com (2603:10a6:4:3f::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Tue, 24 Aug 2021 17:09:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT030.mail.protection.outlook.com (10.152.20.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 17:09:23 +0000 Received: ("Tessian outbound 56612e04f172:v103"); Tue, 24 Aug 2021 17:09:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 664e9bb04698cbea X-CR-MTA-TID: 64aa7808 Received: from 834bda6ae0a2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F1FC3048-9BB5-4EF5-89D4-0E4B74DA7D6C.1; Tue, 24 Aug 2021 17:09:17 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 834bda6ae0a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 24 Aug 2021 17:09:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kc15ibUkbg3p1urTT3oyO0DgDLh+TECYVok9ZpYiQ6TkqvrZ13hDObIbQR1YzpnTwDWE+vDX7lIe46uVIPFF5q4r8RgwPS5GyaBo3gxNgHnKI+fgM9xOkqOpqQ2wBveydiJEUYNiVn0GmeaUuCTieEzP0Gz+JQwCXckC68im1WQnU03TB4BvWsASQoblVNaTJrA5nMGQ12Wb2oL3wXeC6luwMeTDtLJIfpIaPNeUATOzBjM0cR6KnHr8M3PDnCLFwKlXkZ8lwBRLpJzRNdHwKCVWgDvuuwiFkxiOWA/5eUHb7wwTp3I9nLPI61NosGF5BhYGL8NadZ1HRiXbOaTcIQ== 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-SenderADCheck; bh=/G/FbCWvYwuf3wbFAjBDS1DbzhW0KWANEVjq8hJUWk0=; b=HAxI2eeP2tOozZ5fTaRfgRYhHu00CXsEyafTtSSJnNZvmXVqwBrSVud10bzNxI7IkPGoRgsAIYPLw1oG99ZshAbYOlzLBcGx+ATK0WBnAH63zkLUtwg38kePKhy8+5YOFPy3b1xf38guqjttGhzUPXLONFsRNZc3x7hEhYa9V1cGjWaXt1Wxsp9QaUTzeSIlZZ2c14WJfcDcFDQa2rR/gztYXQa/dDGhcN2KY2GvEmFDEr1UUOgIorVgXoz06PQDS7GEBcFtrFZHkHRcVfnt7cSKt9H3YfjgkCMiUYsbPgYK6BD8b8u74VGJhxCGC5zyr1prd8ZG+RdzswnRZsdr+Q== 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 VE1PR08MB5599.eurprd08.prod.outlook.com (2603:10a6:800:1a1::12) by VI1PR08MB2829.eurprd08.prod.outlook.com (2603:10a6:802:22::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 17:09:14 +0000 Received: from VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::c437:fa2b:33:c8ba]) by VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::c437:fa2b:33:c8ba%9]) with mapi id 15.20.4436.022; Tue, 24 Aug 2021 17:09:14 +0000 To: Noah Goldstein Subject: [PATCH 2/5] benchtests: Add new random cases to bench-memcpy-random.c Thread-Topic: [PATCH 2/5] benchtests: Add new random cases to bench-memcpy-random.c Thread-Index: AQHXmQQ0qzx2yGtFtkKr7NICmA6tQQ== Date: Tue, 24 Aug 2021 17:09:13 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: d4030836-f739-419a-2cb9-08d96721ebd3 x-ms-traffictypediagnostic: VI1PR08MB2829:|DB9PR08MB6570: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: L0bZdvYMduWheHe0avA0tcLjfXPXNTchLZ77mB9sEv18gp0/KuzdYtPtnvWvsoRGYUZW2REmwAMuYs4xZI9o6su1MKO8xoT/WrskOhTB716DLOCb6PPYOH/8RPm7/0mq3bF6bh+5Nm/JoMkRsRTFVgdmqibv/Po7iHMs3uqnuARKxoot7gdxDxvKFR4aWewg0pDOqBj2/SXoU0fUb1AHVVug4+AFCYWXITofPfkGkD9d3n+zFREUZpwW9+c+LiXrsql1jF6OOkKAtvEwTOOdUFQDXsQEB6Nk57RkNB6/G2MxxAc/OmQB105K64ATJrXBuZgipO60nFDlD94ItP3B4SaDZXYynxT60zdPXJKbnlEGBYsSNaIQ+VPZXIxaHeOWZcy7AJB9HZlIMptIzIQhjfxknTXGxXuT3ZviuRJDaClfdCLd9yhuobjdrsg4l+uyXQ5QPp7B6XwpnOXbHX6MwlutvratZQ5SgqlZD8epl3K3dEAwmxHJxsiNy9yQ6VwcxckYvelaAaKGLIkf7eerdfMXZyx5aJu6B3CN80dHuLwhW/25A2Y2L3Kula7xI1k279SnV9D9WWn16HtSMYNQc5BtSOKcAPcb24Nf4H70BV+VZhuArH/5qBEUpiKQ9QVa630CXNl6/98OUGxef37i/qH+8uqC3VV/rHQDSeBSGMPJdVaQWAB0doUo2IYn6JRVIryLmFJkpJ3/71eiGuTQTw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5599.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(39850400004)(346002)(366004)(4326008)(6916009)(71200400001)(76116006)(66556008)(66946007)(66446008)(66476007)(64756008)(6506007)(55016002)(5660300002)(2906002)(8676002)(186003)(7696005)(86362001)(38070700005)(316002)(91956017)(8936002)(122000001)(478600001)(52536014)(9686003)(26005)(33656002)(38100700002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?9TEgldXDETvC72dqCCm+4VulRhhjf3YhSHhgDJEOeJmMXCzjb968R5j1Fj?= =?iso-8859-1?Q?2WwY44TkPeJk1xdEqzt03oRQQGc8Ywk7Rz1CH/DWxNJM3BMW/u+MJJptS8?= =?iso-8859-1?Q?vMXqc47DBclssj1vdkaEkwqHw3kwN2h709CvJS8Z7L8+2eDzEceCdRG2am?= =?iso-8859-1?Q?WF3156I1JvMndmGQIglqtPbK7+2XFHXpUEstnY5I6jQpl4vFZG9CkvkGKP?= =?iso-8859-1?Q?0DwRKgk/xRNylJKnvZwQuDVC4o9oKvsmB3QF5SSiR8PjewtQsOcnfQXFhE?= =?iso-8859-1?Q?cH62EPmMPEXbKTXYC44c9A8fW62q0D8jNzyK3+Lv25I1dJsEmdfFPNUsuc?= =?iso-8859-1?Q?teuWw5GLK6uV2f5FLX5jGTzXeq7Qbw1h5a/3MXu1P0WRpWYhy4/BOgI1yL?= =?iso-8859-1?Q?tPsKnDj68f4xyB4k8FR7B6aZKgXUroZxz43Z8gR05eHOYLrUdg7MMsi+3Q?= =?iso-8859-1?Q?q2wF0IWwWXYpOfw/DHp1T7zQvNM6phOB+BCS71FrtCTFD7BAIn3/sCoj9m?= =?iso-8859-1?Q?ClDcZ8RySYHw9tJqiye68H4XqfnYv5CQ13ut+eAxzNv0TwB4O7LyMeQvSF?= =?iso-8859-1?Q?BO7zsAgeKrgbvCfPucAgo+fEsfGyUbGz99i59hVkPDDCW9HWdNoDhmluZp?= =?iso-8859-1?Q?7c9EXIevdRiRjr0q17uTc+cVas+Zx37Irxe5vRitd8IevE5ZdGytHp3he6?= =?iso-8859-1?Q?M/wf94kE2SQlobX0sssNxyGsk+TRXyLiJ+3G3jKjZI/JaMXmeRBaUjYiek?= =?iso-8859-1?Q?Ie4spBJNx5CqUlyqvVCd5tc2OVTZngeqV+BNg2Co1hKe8NwU+gVWX6Q9vY?= =?iso-8859-1?Q?skF/902yhg3EpNCO4s5yP+D0L4a8483b7B9aEyYbKoM77qA6Y8icvSn5cL?= =?iso-8859-1?Q?9mqUei6DDVGiCbeXLUu5GUNSuSk4OXLjSzcjhlg0yH/S7shuPJuHnrUZUv?= =?iso-8859-1?Q?pD8zUUkrvIAah4SYI4ZB/ItuF0hnH8k/xTRlUhB4QL9PGACtld3IswVks/?= =?iso-8859-1?Q?i2mlMcutZY5aYE78N7/InTM1agVITwkyxkiJR6CWWGNyG/aERU5am3wJtC?= =?iso-8859-1?Q?atTAr3vN2KjeLijSKQQb74QI8gx2mX8sYw4P4rchz5Em51rB2JMHOmPmzj?= =?iso-8859-1?Q?NPvTYxCwjAiCuD1nCXNkUp785jaOdvKfDxzyDIPgjaZLORno3uRIPBOzmV?= =?iso-8859-1?Q?kGkG3mLteE+6W0wvO0o3qZLTmsreVpOIStqymzSAXaEhp1DYpXIelcEFmj?= =?iso-8859-1?Q?Oo3roagJNyFmlf7rFa4OaQPZsXdN021VBUB/o1TGwTeLmJr0BNcP/jNL+1?= =?iso-8859-1?Q?vrgs4gx/gj466QT43sSxpCGLWiuZ9ZLWlQgxGiEKzJqURQQ=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2829 Original-Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 1c8227cc-78f0-415c-1e30-08d96721e60d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KwQ0NQa51DUTksKeCNJMd7GXTkIG78tbgxACAl20ntVQ6CcUgPG0ZzdQ4VRaI9ROLQmzgEa2s/WckQasHQUq99Kov0rvu6rk4SjENfrs5OZUTuhueTJM+F/GL4MVLbe+XRf0Re59OLDMhJ3Z1zhVPZ+IEtjmRiofZmyeLwM+aKEQQWKCFMY/g/xUy2pEkmbLn3UkHM9nHt2hrKPVGnIVGyG5uCRO+yA2N+09Yi+cTQuJb8uRkoqJQKcqAHu+7FhZvfBNlDYGxVH59TfnIaYVLqjnirKg21etUyg0ZiVe2ALssOTJ9j7UvFZP1LHPSqaSbNWvEZbf1JxgjFiAEXYDPHzX59+bCrLP6tdG+31W2ezpd8e1tlG2nIH1EkoOlQiVfzIwmPEL1ZEdWq4F4AutNI3A9C84cEt2qNmV7qwj5mZ6OQOMutY+viImEqLxgxjyz8YEo7xMOD2aiAzF+u034jH9JrYj10KMKWkoIHMR76RUtmToBA5Zrvtvr5BF4H7m2APo7W79EfOf5Ekf17nEiz9oHqEBX7hC6/RmIvP8ZxTGMhYVOONPTMKUQURqo53pkcmxXBo9cc4unLVfhzOag4JttJ1QERfcTIBeUtgVuLVpY6QRsxclJY9Xw2J7Pg/zVuNSMkrk9XwMJ0JkWbiCLSKXw2QseQTsofZHolEWtPw4gmgEjUtNLd1FrPjLGVrNCnn0zQgBLMSqZrHRR+zp9Q== 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:(4636009)(46966006)(36840700001)(4326008)(7696005)(6506007)(2906002)(508600001)(356005)(52536014)(336012)(86362001)(9686003)(8936002)(8676002)(70586007)(36860700001)(82310400003)(47076005)(6862004)(26005)(33656002)(70206006)(55016002)(81166007)(5660300002)(316002)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 17:09:23.7632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4030836-f739-419a-2cb9-08d96721ebd3 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: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6570 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: , From: Wilco Dijkstra via Libc-alpha Reply-To: Wilco Dijkstra Cc: 'GNU C Library' Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Hi Noah,=0A= =0A= > This commit adds three new benchmarks for the SPEC2017=0A= > distribution. One randomized if dst > src and the other two set it=0A= > either 1/0.=0A= =0A= What is the goal of this? Have you ever seen memcpy do something=0A= radically differently depending on whether src < dst (assuming no overlaps)= ?=0A= Generally it's the same basic loop that gets used, so I don't see the usefu= lness=0A= of adding this.=0A= =0A= Some comments on the implementation details are below, there are=0A= several issues that need to be resolved.=0A= =0A= > As well add some tests for fixed sizes with randomize alignment and=0A= > value of dst > src. This can be useful for testing different alignment=0A= > configurations.=0A= =0A= This tests fixed size copies from 1KB to 128KB. Large copies are typically= =0A= aligned, so I'm not sure it makes sense to use the random alignment =0A= distribution for small copies here.=0A= =0A= -#define MIN_PAGE_SIZE (512*1024+getpagesize())=0A= +#define MAX_TEST_SIZE (512*1024)=0A= =0A= This makes sense. Please also use it in the loops. Also it may be=0A= worthwhile to increase this value a bit if larger sizes are what you=0A= are after (and the minimum size of 4K could be increased a bit as=0A= well as L1/L2 caches have increased a lot in recent years).=0A= =0A= +#define MIN_PAGE_SIZE (3*MAX_TEST_SIZE+3*getpagesize())=0A= =0A= I don't get this at all. The goal is to copy within the MAX_TEST_SIZE=0A= region, not to copy outside it. And why 3 times the size?=0A= =0A= typedef struct=0A= {=0A= - uint64_t src : 24;=0A= - uint64_t dst : 24;=0A= - uint64_t len : 16;=0A= +/* 26 bits for src and dst so we have extra bit for alternating dst >=0A= + src without a branch. */=0A= + uint64_t src : 26;=0A= + uint64_t dst : 26;=0A= + /* For size < 4096 12 bits is enough. */=0A= + uint64_t len : 12;=0A= } copy_t;=0A= =0A= This doesn't make any sense, where do we need offsets larger than 2^24?=0A= =0A= +static size_t=0A= +init_copy(size_t max_size, int dst_gt_src)=0A= +{=0A= + size_t i, dst_offset, src_offset;=0A= + if (dst_gt_src <=3D 0)=0A= + {=0A= + dst_offset =3D 0;=0A= + src_offset =3D MAX_TEST_SIZE + getpagesize();=0A= + }=0A= + else=0A= + {=0A= + dst_offset =3D MAX_TEST_SIZE + getpagesize();=0A= + src_offset =3D 0;=0A= + }=0A= =0A= This doesn't make sense since this is now copying outside of the region,=0A= effectively enlarging the region but also always reading from one part and= =0A= writing to another. The data outside the region is uninitialized which mean= s=0A= it is using the zero page which gives unrepresentative results.=0A= =0A= + /* Create a random set of copies with the given size and alignment=0A= distributions. */=0A= for (i =3D 0; i < MAX_COPIES; i++)=0A= {=0A= + dst_offset =3D dst_gt_src =3D=3D -1=0A= + ? (rand() & 1) ? MAX_TEST_SIZE + getpagesize() : 0= =0A= + : dst_offset;=0A= =0A= Same here. If you want to force src > dst then just skip cases where=0A= src < dst. Similarly for avoiding accidental overlaps (which are likely=0A= to happen for small values of max_size).=0A= =0A= Given the much larger sizes used for some tests, it is also worth=0A= ensuring the copy stays within the region.=0A= =0A= copy[i].dst =3D (rand () & (max_size - 1));=0A= copy[i].dst &=3D ~dst_align_arr[rand () & ALIGN_MASK];=0A= + copy[i].dst +=3D dst_offset;=0A= copy[i].src =3D (rand () & (max_size - 1));=0A= copy[i].src &=3D ~src_align_arr[rand () & ALIGN_MASK];=0A= + copy[i].src +=3D src_offset;=0A= copy[i].len =3D size_arr[rand () & SIZE_MASK];=0A= }=0A= + return i;=0A= +}=0A= =0A= +static void=0A= +do_test (json_ctx_t *json_ctx, size_t max_size, int dst_gt_src)=0A= +{=0A= + size_t n;=0A= + memset (buf1, 1, max_size);=0A= =0A= Note this doesn't initialize the extra data in the buffer which creates=0A= odd performance behaviour due to the zero page.=0A= =0A= + n =3D init_copy(max_size, dst_gt_src);=0A= json_element_object_begin (json_ctx);=0A= - json_attr_uint (json_ctx, "length", (double) max_size);=0A= + json_attr_uint (json_ctx, "max-alignment", (double) max_size);=0A= =0A= max-alignment, where does that come from???=0A= =0A= json_array_begin (&json_ctx, "results");=0A= for (int i =3D 4; i <=3D 512; i =3D i * 2)=0A= - do_test (&json_ctx, i * 1024);=0A= + {=0A= + if (i * 1024 > MAX_TEST_SIZE)=0A= + continue;=0A= =0A= It's much easier to change the for loop to i =3D 4096 to MAX_TEST_SIZE=0A= and remove the various i * 1024. Then changing MAX_TEST_SIZE just works.=0A= =0A= Cheers,=0A= Wilco=