From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 5327D38618BB for ; Sat, 22 May 2021 04:52:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5327D38618BB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Paul.Zimmermann@inria.fr IronPort-Data: =?us-ascii?q?A9a23=3AfmQUS60Mg8M3ltNovfbD5R1zkn2cJEfYwER7XOP?= =?us-ascii?q?LsXnJgjJwgT0PxmRNX26BPvrZYWWkKIt/aoW2p0xXsJ+AytE2QQE+nZ1PZyIT+?= =?us-ascii?q?JCdXbx1DW+pYnjMdpWbJK5fAnR3huDodKjYdVeB4Ef3WlTdhSMkj/jQG+ClULe?= =?us-ascii?q?s1h1ZHmeIdg9w0HqPpMZp2uaEsfDha++8kYuaT//3YDdJ6BYoWo4g0J9vnTs01?= =?us-ascii?q?BjEVJz0iXRlDRxDlAe2e3D4l/vzL4npR5fzatE88uJX24/+IL+FEmPxp3/BC/u?= =?us-ascii?q?5lbPybkBirrz6ZFXUzCoPHfH6xEUbzsAx+v9T2P40UU5Kj3O7ntV0xc9IvJq2Y?= =?us-ascii?q?QYvJKzF3uoHO/VdO3ouZ/QYouCbfhBTtuTWlSUqaUDEwv9rDUszPIcdvPpoKW5?= =?us-ascii?q?L/P0cbjsKa3irg+O8y/eyTvFsj+w4K9TxN44As2ttizbDAp4OQJrGQq/P5NVdm?= =?us-ascii?q?isvrs9LFPfaIcEebFJSgL7oC/FUEksQDZsikaGsgWP+entWsjqoSWMMyzC75GR?= =?us-ascii?q?MPHLFabI5ouC3ePg=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A2QWIdq5q9aVSvBa5GQPXwKvXdLJyesId70hD?= =?us-ascii?q?6qm+c3Nom6Oj/PxG8M536fawslgssQ8b8+xoUZPoKU80t6QU3WB7B9aftWfd1F?= =?us-ascii?q?eVEA=3D=3D?= X-IronPort-AV: E=Sophos;i="5.82,319,1613430000"; d="scan'208";a="382162747" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2021 06:52:17 +0200 Date: Sat, 22 May 2021 06:52:17 +0200 Message-Id: From: Paul Zimmermann To: Shen-Ta Hsieh Cc: libc-alpha@sourceware.org, ibmibmibm.tw@gmail.com In-Reply-To: <20210522002227.2234377-2-ibmibmibm.tw@gmail.com> (message from Shen-Ta Hsieh via Libc-alpha on Sat, 22 May 2021 08:22:26 +0800) Subject: Re: [PATCH v6 2/3] x86_64: roundeven with sse4.1 support References: <20210522002227.2234377-1-ibmibmibm.tw@gmail.com> <20210522002227.2234377-2-ibmibmibm.tw@gmail.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sat, 22 May 2021 04:52:20 -0000 Dear Shen-Ta, > Here is a benchmark result on my AMD Ryzen 9 3900X system: > > * benchmark result before this commit > | | roundeven | roundevenf | > |------------|--------------|--------------| > | duration | 3.77659e+09 | 3.77504e+09 | > | iterations | 3.97043e+08 | 4.36752e+08 | > | max | 83.714 | 58.861 | > | min | 7.144 | 6.27 | > | mean | 9.51179 | 8.64345 | > > * benchmark result after this commit > | | roundeven | roundevenf | > |------------|--------------|--------------| > | duration | 3.76913e+09 | 3.76923e+09 | > | iterations | 5.55921e+08 | 5.64822e+08 | > | max | 211.698 | 439.09 | > | min | 6.498 | 6.422 | > | mean | 6.77998 | 6.6733 | I wonder why the max times have increased by a factor 2.5 and 7.5. In my experiments I noticed that the "mean" time was quite stable, while the "max" time could vary a lot between different runs. Thus I usually run 5 times "make bench" and keep the smallest times: $ ./testrun.sh benchtests/bench-roundeven You can also try make USE_RDTSCP=1 bench (cf benchtests/README). And it would be nice to have figures on another hardware (for example Intel). Best regards, Paul Zimmermann