From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 908F53858412 for ; Wed, 20 Oct 2021 15:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 908F53858412 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19KFMuSg012564; Wed, 20 Oct 2021 11:35:47 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btnpu8agm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 11:35:47 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19KFQG9u028874; Wed, 20 Oct 2021 11:35:46 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btnpu8ag0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 11:35:46 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19KFNYpJ015358; Wed, 20 Oct 2021 15:35:45 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma04dal.us.ibm.com with ESMTP id 3bqpccu9gt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 15:35:45 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19KFZiwW30212752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Oct 2021 15:35:44 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A3F68BE05D; Wed, 20 Oct 2021 15:35:44 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E02CBE054; Wed, 20 Oct 2021 15:35:44 +0000 (GMT) Received: from localhost (unknown [9.160.187.233]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 20 Oct 2021 15:35:43 +0000 (GMT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20210805074733.433430-1-naohirot@fujitsu.com> <163456183281.2142698.11944761470468149892@localhost.localdomain> Subject: Re: [PATCH v3 2/5] benchtests: Add memset zero fill benchtest From: "Lucas A. M. Magalhaes" To: Wilco Dijkstra , libc-alpha@sourceware.org, naohirot@fujitsu.com Date: Wed, 20 Oct 2021 12:35:42 -0300 Message-ID: <163474414241.24618.5298374761029169472@localhost.localdomain> User-Agent: alot/0.9.1 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7fFB6wJcU-gHZC5IXlbXhmppopMJxhhw X-Proofpoint-GUID: mTFK_FfkTrV6CXctcNU5vEWrKkfrV0dl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-20_05,2021-10-20_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110200089 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Wed, 20 Oct 2021 15:35:54 -0000 Hi Wilco, > > By doing this you are measuring just the call it self and accumulating > > the results. This is indeed not measurable for really small lengths. > > You could try moving the memset and the timing out of the loop and > > measure the time spent in multiple runs. To fix the memset you could > > memset a bigger buffer and move the s pointer on each loop. I guess this > > will reduce the variations Wilco mentioned. >=20 > That would basically end up the same as bench-memset-walk.c given that > you need a huge buffer to get reasonable accuracy (bench-memset does > 8192 iterations by default, and that is still inaccurate for small sizes). > In that case it would be easier to improve bench-memset-walk.c rather than > adding yet another benchmark that is too inaccurate to be useful. Yeah, I agree with you. >=20 > Alternatively we could use the timing loop I suggested which allows any > pattern of zero/non-zero to be tested accurately: >=20 > TIMING_NOW (start); > for (j =3D 0; j < iters; j++) > CALL (impl, s, memset_value[j & MASK], n); > TIMING_NOW (stop); >=20 Sorry but I suppose don't understood your suggestion completely. The memset_value array will hold patterns like [0,0], [0,1] or [1,1], right? If so, this will not work to measure the zero-to-one pattern for example, as it will be mixing zero-to-one with one-to-zero calls. In order to measure just an specific patter the buffer must be loaded previously of the timing loop. --- Lucas A. M. Magalh=C3=A3es