From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44674: 28.0.50; Adding current-cpu-time for performance tests Date: Mon, 16 Nov 2020 10:18:36 +0200 Message-ID: <1BDDC2C4-2831-460F-AC48-C353664D28D2@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11053"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android To: 44674@debbugs.gnu.org, monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 16 09:19:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keZjD-0002hd-12 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Nov 2020 09:19:11 +0100 Original-Received: from localhost ([::1]:38840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keZjC-00027M-34 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Nov 2020 03:19:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keZj5-000272-67 for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 03:19:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keZj4-0006TV-GS for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 03:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1keZj4-0008NF-CV for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 03:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Nov 2020 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44674 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, 44674@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 44674-submit@debbugs.gnu.org id=B44674.160551473132166 (code B ref 44674); Mon, 16 Nov 2020 08:19:02 +0000 Original-Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 08:18:51 +0000 Original-Received: from localhost ([127.0.0.1]:55004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keZit-0008Mj-GM for submit@debbugs.gnu.org; Mon, 16 Nov 2020 03:18:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keZiq-0008ME-Dl for 44674@debbugs.gnu.org; Mon, 16 Nov 2020 03:18:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58256) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keZik-0006NZ-Qu; Mon, 16 Nov 2020 03:18:42 -0500 Original-Received: from [2001:4df7:1:ac2::1] (port=42956) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1keZij-0007Dw-2G; Mon, 16 Nov 2020 03:18:42 -0500 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193412 Archived-At: On November 16, 2020 9:58:40 AM GMT+02:00, Eli Zaretskii w= rote: > On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier > wrote: > > Package: Emacs > > Version: 28=2E0=2E50 > >=20 > >=20 > > I tried to write a test for the performance problem seen in > bug#41029, > > but found it very difficult to make it work half-reliably because we > > only have access to wall-clock time from Elisp=2E > >=20 > > So I suggest we add a new primitive `current-cpu-time` with which > > those > > tests seem to be at least somewhat doable=2E > >=20 > > See my current patch below which includes a test for that > > performance bug=2E It clearly requires adding w32 support (or > > fetching more clock functionality from gnulib) but I don't know how > to > > do that=2E >=20 > AFAIU, using 'clock' here is not the best idea, as there are caveats > wrt to calling 'system', and the origin of the returned value is not > well defined to be portable=2E >=20 > I suggest to use 'times' instead=2E For w32, we could easily implement > it, as we already have that functionality for 'getloadavg'=2E Btw, once this goes in, how about making benchmark-run use it?