GNU bug report logs - #44674
28.0.50; Adding current-cpu-time for performance tests

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Monnier <monnier@HIDDEN>; dated Mon, 16 Nov 2020 01:08:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 22:09:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 17:09:57 2020
Received: from localhost ([127.0.0.1]:57595 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kemhB-0007XP-Lt
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 17:09:57 -0500
Received: from quimby.gnus.org ([95.216.78.240]:39548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kemhA-0007XC-6a
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 17:09:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=5xxS1aPYvr6hYRJLkisryYQPQYJwTyfd6WVG29N9w9s=; b=c1y6Oh28C2+D77sSUuR/16HyEv
 rO1SPsIiHuwkXSXkrSKta0LZmDUMrA5YCtT5p4gvak9zJAckdGTXzeKhLiy7cnqDq3sDOqULbOstW
 h/+rMCWmh3t9XD8yJid3DibzgLA18kkO9tZxHfhXyi5Hyt6f6BIJSVakDEB7cj7EnTTg=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kemh1-00069c-0L; Mon, 16 Nov 2020 23:09:49 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
 <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
 <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
 <831rgtte5d.fsf@HIDDEN>
 <CAArVCkTicT1zE1pbvwe-p+mA7L_6U=spe3zR4dSTNtA9vpvbvg@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEU7NTFDOzMYFxdO
 RTlqXUqeim7////s1RqTAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+QLEBYHNBCWKAoAAAGtSURBVDjL
 dZRNjoMwDIVtSPcJ9AA9AkzSPYiwn0rk/lcZ/8SBIo0XbfHHs014LmDwEAJgoPDooUYHYL8FwAVQ
 YOD0XREugU3DCt/yvr8qRDIq6e+lIsccwtNbrY7nHKPFk6A3IOlMscWYCKABuky5RpKCCvrY0jm/
 tys4yZaoXJA2BDRdSqHPfZPpFHB6p3w56Dvnb1A07mCv+XLsMjS3F1BaEMgG3AUcfbZaDFqlsk6J
 QbyD4/lJWktLNcHPHvTMFKggl2N9FMgXheSXbv+44nmULzABPH77KXp3cClv4AAGENKigC4HSHRG
 /NIeC8w4KyA7dZBXfckEiDvpTo8+wLGw4wDfC7vNyaFoqYl80k99IuUYnvwcs2cgViojIE2GEWVa
 AW5LedtncAugn1GOncxFCrYO3UJKPM2OA/wTA93GHgW2BncLzbs9iqcjjRL8qSDAPgrXXAUuozre
 38GKdanOdVQw6cbynn1N5WQ5bdca7Pj8anacL506eNnajmL08zletmvjLFvjG7DdjOe6S/OX1dG9
 PYH2jqfI11X7gAnq/bbOi/0DaM7G6v4A8wB8azD/GisAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAt
 MTEtMTZUMjI6MDc6NTErMDA6MDDnVxAEAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTExLTE2VDIy
 OjA3OjUxKzAwOjAwlgqouAAAAABJRU5ErkJggg==
X-Now-Playing: Various's _Amchitka (2)_: "Joni Mitchell - The Gallery"
Date: Mon, 16 Nov 2020 23:09:45 +0100
In-Reply-To: <CAArVCkTicT1zE1pbvwe-p+mA7L_6U=spe3zR4dSTNtA9vpvbvg@HIDDEN>
 (Philipp Stephani's message of "Mon, 16 Nov 2020 19:31:47 +0100")
Message-ID: <87zh3huf6e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philipp Stephani <p.stephani2@HIDDEN> writes: >> It does
 now, but we may want to change that. > > That would be a breaking change.
 Yeah, we can't do that. But a new benchmark-run command would be fine. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44674
Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Philipp Stephani <p.stephani2@HIDDEN> writes:

>> It does now, but we may want to change that.
>
> That would be a breaking change.

Yeah, we can't do that.  But a new benchmark-run command would be fine.

>> Does it really make
>> sense to "benchmark" something using elapsed time?
>
> Yes, the benchmarks I know all measure wall time. After all, that's
> what the user cares about.

The most used benchmark every (I'm guessing), which is the "time" shell
command, reports both.  Most people only care about the "real" (i.e.,
wall time), though, as you point out.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 20:10:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 15:10:20 2020
Received: from localhost ([127.0.0.1]:57405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kekpQ-0006cT-5i
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:10:20 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44233)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kekpO-0006cD-EO
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:10:19 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E76AB4415EA;
 Mon, 16 Nov 2020 15:10:12 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6A7F144156E;
 Mon, 16 Nov 2020 15:10:11 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605557411;
 bh=xRV4Kjlb0vDa52PpATwJ0GhyhYJjvMyAa/hlB23KwL8=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=TrJPRbq1g/p5i0qf33ytKarupm0OO0Yh+JCb9fITzARIYwP5QoWakPSPX/KEvvUDk
 OEYD9BXIAQrPzTjq0Upd3u/7wxbaNCOxT1GtsLa8mtKRzRnqUxnRpO+dfhlZeMzQET
 ROPaLiZtM1RIbOeuzXWsffl3jVxT4++oShG7cet/b0plcVIxxvayxg9lquZfWHmqH2
 y/56JNRqF70ERAsjFBTHTBwmMmUAoKTdk5TDlGh6zVk4FRILIua1y7mJYZozn4oIul
 z8wUagcSCgHRsiICgmJSQTsFVqwA5e4YSNrDh20SXkGpcM5MAvrjsINFoxOKbJXWVJ
 CeHOFH+DX4MMw==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34EA71202A7;
 Mon, 16 Nov 2020 15:10:11 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
Message-ID: <jwv3619hxqe.fsf-monnier+emacs@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <CAArVCkQCtJFt4rUzXmGjdgo62UZ=A7wc_nEO9TieXYWUvjyzCw@HIDDEN>
Date: Mon, 16 Nov 2020 15:10:10 -0500
In-Reply-To: <CAArVCkQCtJFt4rUzXmGjdgo62UZ=A7wc_nEO9TieXYWUvjyzCw@HIDDEN>
 (Philipp Stephani's message of "Mon, 16 Nov 2020 19:32:35 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.068 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattiase@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> > > 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.
>> >
>> > What do you mean by "origin" and by "calling 'system'"?
>>
>> Quoting https://pubs.opengroup.org/onlinepubs/9699919799/:
>>
>>           The clock() function shall return the implementation's best
>>           approximation to the processor time used by the process
>>           since the beginning of an implementation-defined era
>>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>           related only to the process invocation.
>>
>> How do you write portable Lisp code that returns consistent results
>> based on such shaky foundations?
>
> For non-walltime clocks, only the difference between two measurements
> is meaningful.

Mabe the API we should expose should give access to the actual time but
only to time-differences, as in:

    (funcall-with-cpu-time FUNCTION)

    Call FUNCTION and return the CPU time used.
    The return value is of the form (TIME . VALUE) where TIME is the CPU
    time used during execution of FUNCTION, measured in seconds, and
    VALUE is the return value of FUNCTION.


-- Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 19:23:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 14:23:15 2020
Received: from localhost ([127.0.0.1]:57364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kek5q-0003MY-Pq
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:23:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49896)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kek5p-0003MK-0L
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:23:13 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39195)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kek5j-0006Id-LB; Mon, 16 Nov 2020 14:23:07 -0500
Received: from [176.228.60.248] (port=2283 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kek5V-0008HT-QI; Mon, 16 Nov 2020 14:23:06 -0500
Date: Mon, 16 Nov 2020 21:22:47 +0200
Message-Id: <83eektrtrs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwvpn4di1pv.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Mon, 16 Nov 2020 13:41:59 -0500)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <83sg99ryla.fsf@HIDDEN> <jwvpn4di1pv.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: mattiase@HIDDEN,  p.stephani2@HIDDEN,  44674 <at> debbugs.gnu.org
> Date: Mon, 16 Nov 2020 13:41:59 -0500
> 
> > Sorry, forgot to answer the 'system' part.  The issue there is whether
> > calling 'system' (and in general waiting for sub-processes to exit) is
> > counted against the process's use of CPU or not.  AFAIK, this is not
> > well defined, either.
> 
> Ah, I must admit that for the cases that interest me the distinction is
> of no consequence.  I don't even know which behavior I'd prefer.

Well, we are talking about a general-purpose API, so the semantics
should be well defined.  And for 'clock', it isn't.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 19:17:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 14:17:17 2020
Received: from localhost ([127.0.0.1]:57324 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kek05-0003B3-3b
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:17:17 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48288)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kek03-0003Am-4L
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:17:15 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39130)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kejzx-0004LI-Tr; Mon, 16 Nov 2020 14:17:09 -0500
Received: from [176.228.60.248] (port=1913 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kejzw-0007t5-O0; Mon, 16 Nov 2020 14:17:09 -0500
Date: Mon, 16 Nov 2020 21:17:02 +0200
Message-Id: <83h7ppru1d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
In-Reply-To: <CAArVCkQCtJFt4rUzXmGjdgo62UZ=A7wc_nEO9TieXYWUvjyzCw@HIDDEN>
 (message from Philipp Stephani on Mon, 16 Nov 2020 19:32:35 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <CAArVCkQCtJFt4rUzXmGjdgo62UZ=A7wc_nEO9TieXYWUvjyzCw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philipp Stephani <p.stephani2@HIDDEN>
> Date: Mon, 16 Nov 2020 19:32:35 +0100
> Cc: Stefan Monnier <monnier@HIDDEN>, Mattias Engdegård <mattiase@HIDDEN>, 
> 	44674 <at> debbugs.gnu.org
> 
> >           The clock() function shall return the implementation's best
> >           approximation to the processor time used by the process
> >           since the beginning of an implementation-defined era
> >           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >           related only to the process invocation.
> >
> > How do you write portable Lisp code that returns consistent results
> > based on such shaky foundations?
> 
> For non-walltime clocks, only the difference between two measurements
> is meaningful.

Which is a limitation, when compared to APIs that always measure since
the program/thread start.  For example, with 'clock' you cannot
measure how long the startup takes.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 19:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 14:15:40 2020
Received: from localhost ([127.0.0.1]:57311 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejyV-00037d-Ol
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:15:39 -0500
Received: from mail1462c50.megamailservers.eu ([91.136.14.62]:37294
 helo=mail267c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1kejyR-00037N-VT
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:15:38 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1605554129;
 bh=R3ZGokGlnKFMGVYQjp3V5MZyLEWISspoiHsM2MK97cc=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=c3pYRzLbJyJzHEzdkCgvfzwOWVScbMfQQens9g0F5c9sPnaRwyVZhVKTFV0VTplhe
 OknvQj84nLiYNpPKN3ffUZDL06X/KF32mObs1osg69HTaiRT4Wc+Dsf+TZPRaK7YtJ
 YYdajiKpuOJxKZYixwOEwsqtWqU1mMj6f2EUpvz8=
Feedback-ID: mattiase@HIDDEN
Received: from stanniol.lan (c-064ae655.032-75-73746f71.bbcust.telenor.se
 [85.230.74.6]) (authenticated bits=0)
 by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0AGJFR72030437; 
 Mon, 16 Nov 2020 19:15:28 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <834klptece.fsf@HIDDEN>
Date: Mon, 16 Nov 2020 20:15:26 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <B9048BB0-5887-4ABA-AE7D-DB915CE10EAF@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <834klptece.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A782F22.5FB2CFD1.0058, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=UL+j4xXy c=1 sm=1 tr=0 a=Ni+dBsiEfW2GqKMPYZim9A==:117
 a=Ni+dBsiEfW2GqKMPYZim9A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=mDV3o1hIAAAA:8 a=lW_Guy-J84I49dianXMA:9 a=CjuIK1q_8ugA:10
 a=_FVE-zBwftR9WsbkzFJk:22
X-Origin-Country: SE
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  16 nov. 2020 kl. 18.13 skrev Eli Zaretskii <eliz@HIDDEN>:
 >> Perhaps not ideal to cons in a timing primitive where low overhead is
 called for. >> What about just returning an integer and have a different way
 to get at TICKS-PER-SEC? > > Why not just return a [...] 
 Content analysis details:   (1.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 44674
Cc: p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

16 nov. 2020 kl. 18.13 skrev Eli Zaretskii <eliz@HIDDEN>:

>> Perhaps not ideal to cons in a timing primitive where low overhead is =
called for.
>> What about just returning an integer and have a different way to get =
at TICKS-PER-SEC?
>=20
> Why not just return a float in seconds instead?

Precision would vary depending on the magnitude of the time stamp (which =
should be irrelevant since only differences are used). Floats are also =
always boxed, for that matter.

> Can you make a case for process-global timing, given that we don't
> control all of the threads, and that some of them are utterly
> unrelated to timing Lisp programs?

If Lisp actions trigger work done in other threads the completion of =
which has to be awaited then those threads are effectively part of the =
same computation. (Admitted, not a very strong case.)





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 19:13:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 14:13:07 2020
Received: from localhost ([127.0.0.1]:57304 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejw3-00033Y-Ae
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:13:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:47400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kejw2-00032v-E0
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:13:06 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39075)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kejvx-0002zW-52; Mon, 16 Nov 2020 14:13:01 -0500
Received: from [176.228.60.248] (port=1534 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kejvo-0005u7-Pu; Mon, 16 Nov 2020 14:12:55 -0500
Date: Mon, 16 Nov 2020 21:12:46 +0200
Message-Id: <83ima5ru8h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
In-Reply-To: <CAArVCkTicT1zE1pbvwe-p+mA7L_6U=spe3zR4dSTNtA9vpvbvg@HIDDEN>
 (message from Philipp Stephani on Mon, 16 Nov 2020 19:31:47 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
 <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
 <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
 <831rgtte5d.fsf@HIDDEN>
 <CAArVCkTicT1zE1pbvwe-p+mA7L_6U=spe3zR4dSTNtA9vpvbvg@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philipp Stephani <p.stephani2@HIDDEN>
> Date: Mon, 16 Nov 2020 19:31:47 +0100
> Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
> 
> Am Mo., 16. Nov. 2020 um 18:17 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
> >
> > > From: Philipp Stephani <p.stephani2@HIDDEN>
> > > Date: Mon, 16 Nov 2020 12:46:07 +0100
> > > Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
> > >
> > > > Btw, once this goes in, how about making benchmark-run use it?
> > >
> > > benchmark-run measures walltime, not CPU time
> >
> > It does now, but we may want to change that.
> 
> That would be a breaking change.

I could argue that it's a bugfix.

> > Does it really make
> > sense to "benchmark" something using elapsed time?
> 
> Yes, the benchmarks I know all measure wall time. After all, that's
> what the user cares about.

??? On a system that is heavily loaded, and Emacs doesn't get an
execution unit close to 100% of the time, the wallclock time can be so
skewed as to defeat any meaningful measurements.  E.g., imagine that
you are running a benchmark while (another version of) Emacs is being
built with "make -jN", with N large enough to make all the cores busy.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 19:07:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 14:07:52 2020
Received: from localhost ([127.0.0.1]:57253 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejqy-0002rB-HT
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:07:52 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8031)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kejqu-0002qP-MH
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 14:07:51 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 647854410F5;
 Mon, 16 Nov 2020 14:07:43 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 41205441058;
 Mon, 16 Nov 2020 14:07:42 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605553662;
 bh=8DPTln/oR+shbAJaygFQxsLCWg2/mffNXKSdwMv6Im4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=I5VvlNPNCAiGQV3CM/PKtR6Ljt1EmI0S9Mgdtws6bUZxaG3Tdk/6wJYtpEPm5ZeSn
 qXZqTzNtEnhJuLi4fq9RspdA+Cudo5DSjx0HOFCWwyJFvDOR10sMfx7PZzCRE2tuiJ
 TOpMRlseOQxY3QHZo3/pY9OJVrkGUsTe2AE6WD2Y4e5kPTF7+pwyKwg1cEVJxlr0v9
 qh3PXQ7uLDYyL0F1aHsEJxSDYSCdsOG9Lo6cnZkaXrtseg2MEAYVAu4FbaTJh9OtmS
 wqi5Z6/0n9cjMABXu0OuViwEa46y0Pe9kTkMXU60fMvl7o+AMsjbyHPQj2xoojAMoF
 hFc4nWv739uaQ==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BEFE5120376;
 Mon, 16 Nov 2020 14:07:41 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
Message-ID: <jwveekti0oq.fsf-monnier+emacs@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
 <CAArVCkRvjYrFiNtGXAd+XyaN0iDcAA4P7TCXj=aJG25cir2BNA@HIDDEN>
Date: Mon, 16 Nov 2020 14:07:41 -0500
In-Reply-To: <CAArVCkRvjYrFiNtGXAd+XyaN0iDcAA4P7TCXj=aJG25cir2BNA@HIDDEN>
 (Philipp Stephani's message of "Mon, 16 Nov 2020 19:39:35 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.068 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattiase@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> Also since I'm not familiar with any of those interfaces, I'd welcome
>> it if someone else could do that if they're interested.
> I wouldn't mind doing it, if there's general agreement that it's worth having.
> But it would really just be:
> 1. clock_gettime(CLOCK_MONOTONIC_ID)
> 2. check for errors
> 3. make_lisp_time

CLOCK_MONOTONIC wouldn't satisfy my needs, because it makes the duration
of execution of a piece of code too depend on OS's scheduling choices.\
In my use case I need to run two chunks of code and make sure their
run-time is not "wildly" different, but with wall-clock time (and
CLOCK_MONOTONIC is close enough to wallclock to suffer from the same
problem) any context switch in the middle of one of the two runs can
cause such "wildly" different results, including make the slow code
appear to be much faster than the fast one.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:42:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:42:09 2020
Received: from localhost ([127.0.0.1]:57204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejS4-00007i-Pu
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:42:09 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39539)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kejS3-00007X-IU
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:42:07 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5472D100257;
 Mon, 16 Nov 2020 13:42:02 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 09297100091;
 Mon, 16 Nov 2020 13:42:01 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605552121;
 bh=GKYSvNBC20wedmgfDWvXM/2NcoNmv90qZbPgtebpyu0=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=HRjMXh0rjQ4F5bfccYe+gevo315pvV8hO3/xeXPYsjImA86DYD7FejL/QrEb4zRpx
 FdUzgl3vfTAv14eitpCnq9vtfcSQshLW+rdL4yJl6FdcGUbkWalxKLhXVevB7yu8to
 6L6894IEX+rQmMLaoYFzB5mppGpxv/+JuNYmzU3NBeqm+dgpxsoF6+xO+1ubL8rQjA
 QS00A89/9o00cmq0WiQpVxoGObLNckVUdKzU9r4lXq0LkK09hwtGdCCgO3s9ZImA7D
 UiAP6BJCmQ709R2A1/o8g048gaX+pLQrbXQjoUxVxkwRhaqHVKXwv4tdHJyNVEKqAw
 6wJ3yb5GOT52A==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C93B6120320;
 Mon, 16 Nov 2020 13:42:00 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
Message-ID: <jwvpn4di1pv.fsf-monnier+emacs@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <83sg99ryla.fsf@HIDDEN>
Date: Mon, 16 Nov 2020 13:41:59 -0500
In-Reply-To: <83sg99ryla.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 16 Nov
 2020 19:38:41 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.057 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Sorry, forgot to answer the 'system' part.  The issue there is whether
> calling 'system' (and in general waiting for sub-processes to exit) is
> counted against the process's use of CPU or not.  AFAIK, this is not
> well defined, either.

Ah, I must admit that for the cases that interest me the distinction is
of no consequence.  I don't even know which behavior I'd prefer.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:41:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:41:23 2020
Received: from localhost ([127.0.0.1]:57199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejRL-00006F-Dl
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:41:23 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2801)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kejRJ-000062-Ja
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:41:22 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3FC2980922;
 Mon, 16 Nov 2020 13:41:16 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1D95D80B34;
 Mon, 16 Nov 2020 13:41:14 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605552074;
 bh=Sy6IZB4iKgBuQv4IRezm0oW6Dsrb58hn8vRtYdZJLJA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=ex3/7RKc80d0peI9a2mGdm6Z4qHiPHD0+vQhXWr1zRMCzIurCBJw5fiw+0EQ57+YT
 N4CA2MZbSpqUd/a39dIu5U+d+bHqUyxWmHyCJyngEYZoGB2VxWvV2CgXJJwK1jVeOr
 ao/I4+J5AXjpEl+/9fMDqOEkk7XNrQ7Y/I1O7nDSJFzng2c3H9Y35iDteE8Qi4c97V
 zU37v/+F27DjOWiM8MwFJSsJ8rotKRn6QWImsygOUiaVZ/Zc6bJGW+6ZIs6HLURwta
 U/6EqaJRShrwvGFMdDeOemgcNKncJXe24M7g/NrcwDDgbG0YWyhI/3AlMKWNGIJ+1U
 T/xGZgC2nyv5g==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D0F501202E3;
 Mon, 16 Nov 2020 13:41:13 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
Message-ID: <jwvv9e5i1qn.fsf-monnier+emacs@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
Date: Mon, 16 Nov 2020 13:41:13 -0500
In-Reply-To: <83y2j1rz2f.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 16 Nov
 2020 19:28:24 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.076 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> What do you mean by "origin" and by "calling 'system'"?
> Quoting https://pubs.opengroup.org/onlinepubs/9699919799/:
>
>           The clock() function shall return the implementation's best
>           approximation to the processor time used by the process
>           since the beginning of an implementation-defined era
> 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 	  related only to the process invocation.
>
> How do you write portable Lisp code that returns consistent results
> based on such shaky foundations?

You only consider differences between measurements.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:39:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:39:53 2020
Received: from localhost ([127.0.0.1]:57194 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejPt-0008V5-1h
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:39:53 -0500
Received: from mail-oo1-f49.google.com ([209.85.161.49]:46205)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1kejPr-0008Us-Vs
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:39:52 -0500
Received: by mail-oo1-f49.google.com with SMTP id c25so4124608ooe.13
 for <44674 <at> debbugs.gnu.org>; Mon, 16 Nov 2020 10:39:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=2edg8j8ChoLnV0b5pwNQBv48BGlSQgrn9Xov3h/fPgk=;
 b=cvslCYwy7qnwb54nkk0O0Gjd/9wBW2bXfkJeNrg5SzFENQs77+eMFb2WjJxTSU5FeY
 2rC+3Qw/eJPZOSmOWdCTt5UqujC3CkodboiBDrSxYFwuk71ng8KvuJiKKwP1Iwt0T23r
 1bz6PQf/m3hJJdROPpLWi/Jw7Yjnh3W3v+Ks6AdlhNuFslyoIV7R/umq8m7BevLvPDz3
 uwpi00qvesfcO2kElCCEBlwCD5jUa9HmMFUdDjZk83agMKkRp78qMV0Vx+GVoShtUKID
 xnKzmiU3mRquC0Qn2b+dNPgpmzYqU5exk2Wgf1UuJk9Mdpu0dyDP2IjGe4S4bmN9dtx8
 9mFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=2edg8j8ChoLnV0b5pwNQBv48BGlSQgrn9Xov3h/fPgk=;
 b=ERmmgU0W+do9f823qxcx/Fjvz1eShATUqI57cOEKESu2s54gSxyI8W3HzPO1zF0wG/
 IAHJq4yVQUIfHIS2jOhwkVRHoIzg1h6JejbUqSH9cYBYL6RWUCwifDVlrlY3ieksYwFH
 gnd2qm5MXndkzeH37QrMrv/AF1LgwtC34T/6AXaILWC7jw4AeBTbWhq4fvViKQAy8P6P
 SfO2wFFmgaOuZ7aYVoyp5Ud4+i+fhKGuMc9mnopebeOzgsvf0Y3T8FvHBZjpY3F7ARBQ
 pk7WVKM3HOeGrjaZzW7n7Ds5Y7oOio5Rds8oEgHSxjjKWoR0/gcjEfZaPH44cyyv8kz1
 5iDQ==
X-Gm-Message-State: AOAM531wvOB+E8TtTCBsLGq+nk+1MBOjnHjVQthKflSoBlbuWBKh5ny+
 6Z9Dwut9TnWOouyiAI8t5tr4IoyJ0lbLugxXAzg=
X-Google-Smtp-Source: ABdhPJyxDZ+0W3u5YJdWk+fylX3OqjEQycHKTrqmULvukdD7YgG9X4W1dUGijCwoSqRd2R7wyzc0Mv9K1QsA6/QHbJc=
X-Received: by 2002:a4a:1a82:: with SMTP id 124mr497201oof.81.1605551986043;
 Mon, 16 Nov 2020 10:39:46 -0800 (PST)
MIME-Version: 1.0
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 19:39:35 +0100
Message-ID: <CAArVCkRvjYrFiNtGXAd+XyaN0iDcAA4P7TCXj=aJG25cir2BNA@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 44674
Cc: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Mo., 16. Nov. 2020 um 16:27 Uhr schrieb Stefan Monnier
<monnier@HIDDEN>:
>
> Philipp wrote:
> > It might be beneficial to use the higher-resolution clock_gettime with
> > CLOCK_PROCESS_CPUTIME_ID if available and only fall back to clock()
> > otherwise.
> >
> > While there, consider also implementing a function to read the
> > CLOCK_MONOTONIC clock =E2=80=93 that should be preferred over the realt=
ime
> > clock for stopwatch-style measurements.
>
> Given that we've lived without any of it for so many years, I'm not sure
> it's worth the trouble.

It's definitely not a pressing concern, but the current approach does
give wrong results if a leap second happens or on other occasions. See
e.g. https://go.googlesource.com/proposal/+/master/design/12914-monotonic.m=
d
for why Go introduced monotonic clock measurements. Other languages
had the distinction between wall clocks and monotonic clocks for a
long time as well (e.g. Java System.nanoTime).

>  Also since I'm not familiar with any of those
> interfaces, I'd welcome it if someone else could do that if
> they're interested.

I wouldn't mind doing it, if there's general agreement that it's worth havi=
ng.
But it would really just be:
1. clock_gettime(CLOCK_MONOTONIC_ID)
2. check for errors
3. make_lisp_time




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:32:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:32:55 2020
Received: from localhost ([127.0.0.1]:57178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejJ9-0008Kz-2J
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:32:55 -0500
Received: from mail-ot1-f53.google.com ([209.85.210.53]:40993)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1kejJ6-0008Km-KN
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:32:53 -0500
Received: by mail-ot1-f53.google.com with SMTP id o3so6431906ota.8
 for <44674 <at> debbugs.gnu.org>; Mon, 16 Nov 2020 10:32:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=alJ5VrglCrDR6X8ia5BwHkRmmKsRHYGVv7DZjFAermo=;
 b=at8Uw+klcd6r9wcQ6g0rHm+xzZcRpdisWXPX/0QMwsJIK4MJpeaJ7zOzyQsr1cT8oG
 +yXQCIJvQMxODWq1jSW8R4TGocd32Jh7/wadlgtz4VBfzhDVg1dkDvESo+ygUbJkjyXh
 trzvIpDLMArH4eImWiszXTHMFNj4tcumK7G7GlNsP9ru+oNEP8dsqCT1vPFdvbVU9zh8
 F5FET7OFuIGRjCUYyJH+UVmXegAzeDY+8JyPbWPC3iBw9YqyKa3BfGIMZunW+6sQJfYR
 iNY0offlcJO+HDAYtz97JFxnujVkgEOH8usSWr/wsD7lEfb0kEtXiKk0QDktE5HcuisE
 jf8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=alJ5VrglCrDR6X8ia5BwHkRmmKsRHYGVv7DZjFAermo=;
 b=Ox01WuOlkim1PEerNaTRu/GY9n7mGSH+X7lWef+qSB54+G6KspwkT/OKAmKyG9vdsb
 39BdSR1tDInhPDWDnzTrM2fjTAu4yRZZuwsdR37M0hOPallLwP2vO7fGVE9f0n0FHsv1
 OlButGVDQeAbISmGJNti8BM70aWTqx5TWenkRyhULc4SBhl+U81McoqlNxC5R9GEHBN4
 N33N2143OjvZqpE1UwkUZiSQpyYqH8GsAv+sAP+6g08sHetnauqQqHb6xJz4NWcJyh8j
 V/qYdtkxXZIePnlhfERkaeulNHz8QQS0GoFqUn//wKLEtK8w21OsImDW+AT9nMlRMR2q
 La2g==
X-Gm-Message-State: AOAM532A5HbHJFBRHlAWvfiiEXh890CZ7ECmK8FzzpnA+ggFQariBLBN
 rCIV+bpppSHJ6naK3TC+5/c1udP5mdfRw7g6lnA=
X-Google-Smtp-Source: ABdhPJxrfQNJ/Lp3Gfux+jGMjq0uHLBfRAA+2mqy+eGN3n2601tX7aR6eTr57DJuLMUD9ZXuhUCHDkvAdT4qd+r9O8Q=
X-Received: by 2002:a9d:d73:: with SMTP id 106mr470439oti.36.1605551567023;
 Mon, 16 Nov 2020 10:32:47 -0800 (PST)
MIME-Version: 1.0
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
In-Reply-To: <83y2j1rz2f.fsf@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 19:32:35 +0100
Message-ID: <CAArVCkQCtJFt4rUzXmGjdgo62UZ=A7wc_nEO9TieXYWUvjyzCw@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 44674
Cc: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Mo., 16. Nov. 2020 um 18:28 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
>
> > From: Stefan Monnier <monnier@HIDDEN>
> > Cc: Eli Zaretskii <eliz@HIDDEN>,  44674 <at> debbugs.gnu.org,  Philipp Stephani
> >  <p.stephani2@HIDDEN>
> > Date: Mon, 16 Nov 2020 10:27:29 -0500
> >
> > > 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.
> >
> > What do you mean by "origin" and by "calling 'system'"?
>
> Quoting https://pubs.opengroup.org/onlinepubs/9699919799/:
>
>           The clock() function shall return the implementation's best
>           approximation to the processor time used by the process
>           since the beginning of an implementation-defined era
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>           related only to the process invocation.
>
> How do you write portable Lisp code that returns consistent results
> based on such shaky foundations?

For non-walltime clocks, only the difference between two measurements
is meaningful.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:32:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:32:08 2020
Received: from localhost ([127.0.0.1]:57175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejIN-0008K0-OG
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:32:07 -0500
Received: from mail-ot1-f49.google.com ([209.85.210.49]:37258)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1kejIJ-0008JK-QN
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:32:06 -0500
Received: by mail-ot1-f49.google.com with SMTP id l36so16973046ota.4
 for <44674 <at> debbugs.gnu.org>; Mon, 16 Nov 2020 10:32:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=xV4wxzqVKKARLB85KdcXrYteVLSLZLPfqkXuL9Ghd10=;
 b=dOw2FttenpNot9o2cRpEKY6EsjW/xw/nfBsYLYcl6FgjAQUIpXcUDzpqDcEXVavbFq
 LNRRKWouEe63dpj9KsPrm0xiJyLXZNOC7i5lH0Mf+V/bGbE+3JWDeo296AeE7Fy+MXwe
 U5cSeb/ZvDW73eHplE0ywa260BDpjSkKaqYuRY4E5fOUD9Tcpii4TJ+ysckhhLvpbetI
 8fmDlBRJ5eHL2hHxakgOoViBKkTuTNywnMhY/aLGEHinGfpuLEb1CznziXNZ0CGCNrFC
 PAKkLnKeEV6L4/mS3MpmvEPkxPpzSTteI6oX+A1mwuLeCCOfUyXkBMwaDSvIaDcEGw+O
 465Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=xV4wxzqVKKARLB85KdcXrYteVLSLZLPfqkXuL9Ghd10=;
 b=DMBI5AxnIwf+yHuG4kh20EaTbgXgPImUHLaMQqWby8hthaWKZL7WOrtoObgUrQwFI5
 jwgrbTsow7wLO4hJDXFYzl462aCl1/lE55M30izRHt2+A+ymPe1pOkflQklW38kiArYt
 Wuck4DNR+Ib1sEQq49vb8qh2bvtDh2qOXnG4TahdbwRNVczj1XQSOnQewvH8NPEyQ0bK
 JuK0W4O3o97bLPWV7JHrs6+a65cXTR4+ri9RnpFf8vrGmZ1T5wtDC9IUcJ6ruqUvJ5qH
 jrHQ/hjZjvfJwXBOXuczNQghZCXAbExAEh+GyfsvBJve1AXSYlraM/3qMIr/cVRkNtax
 Jl3Q==
X-Gm-Message-State: AOAM5321GW2oZAZuF9nM3I3et1ij2tauXWcAwufclsu5igsYiIuJ3gR2
 KMy57Da0elUb9Nta1Y1K/HV69wioECmJ22jYfYI=
X-Google-Smtp-Source: ABdhPJwnycBB8uMaEj7pJXl0rcTIUSSTSN4aTS4PgiSnA+7NocgbyVNXODdmXFxU+63WsDPnpWdwNxamii8GPpOFRFo=
X-Received: by 2002:a9d:72c4:: with SMTP id d4mr425053otk.149.1605551518176;
 Mon, 16 Nov 2020 10:31:58 -0800 (PST)
MIME-Version: 1.0
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
 <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
 <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
 <831rgtte5d.fsf@HIDDEN>
In-Reply-To: <831rgtte5d.fsf@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 19:31:47 +0100
Message-ID: <CAArVCkTicT1zE1pbvwe-p+mA7L_6U=spe3zR4dSTNtA9vpvbvg@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 44674
Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Mo., 16. Nov. 2020 um 18:17 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
>
> > From: Philipp Stephani <p.stephani2@HIDDEN>
> > Date: Mon, 16 Nov 2020 12:46:07 +0100
> > Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
> >
> > > Btw, once this goes in, how about making benchmark-run use it?
> >
> > benchmark-run measures walltime, not CPU time
>
> It does now, but we may want to change that.

That would be a breaking change.

> Does it really make
> sense to "benchmark" something using elapsed time?

Yes, the benchmarks I know all measure wall time. After all, that's
what the user cares about.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:28:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 13:28:03 2020
Received: from localhost ([127.0.0.1]:57164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kejEQ-0008C2-VJ
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:28:03 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36730)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kejEP-0008BY-DN
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 13:28:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38377)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kejEJ-00050c-G4; Mon, 16 Nov 2020 13:27:55 -0500
Received: from [176.228.60.248] (port=2750 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kejEH-0001xN-7j; Mon, 16 Nov 2020 13:27:54 -0500
Date: Mon, 16 Nov 2020 20:27:47 +0200
Message-Id: <83k0ulrwbg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Andreas Schwab <schwab@HIDDEN>
In-Reply-To: <87o8jx9o8v.fsf@HIDDEN> (message from Andreas Schwab on Mon,
 16 Nov 2020 18:59:28 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <83sg99ryla.fsf@HIDDEN> <87o8jx9o8v.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org,
 monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Andreas Schwab <schwab@HIDDEN>
> Cc: monnier@HIDDEN,  mattiase@HIDDEN,  p.stephani2@HIDDEN,
>   44674 <at> debbugs.gnu.org
> Date: Mon, 16 Nov 2020 18:59:28 +0100
> 
> On Nov 16 2020, Eli Zaretskii wrote:
> 
> > Sorry, forgot to answer the 'system' part.  The issue there is whether
> > calling 'system' (and in general waiting for sub-processes to exit) is
> > counted against the process's use of CPU or not.  AFAIK, this is not
> > well defined, either.
> 
> There's times and getrusage.

Right.  I was talking about 'clock', and I proposed to use 'times',
instead for that very reason.  It could also be a more useful feature
to provide user and system time separately, btw.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:59:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:59:33 2020
Received: from localhost ([127.0.0.1]:57122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keimr-0007TI-HI
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:59:33 -0500
Received: from mail-out.m-online.net ([212.18.0.10]:35954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1keimp-0007TA-VI
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:59:32 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4CZcKF5LVZz1ry9m;
 Mon, 16 Nov 2020 18:59:29 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4CZcKF3Ydgz1qtZ4;
 Mon, 16 Nov 2020 18:59:29 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id HTZZaI-13xQ0; Mon, 16 Nov 2020 18:59:28 +0100 (CET)
X-Auth-Info: hny21BKLv4bS4sRhXPisvXCqQdazWyTGhrmOeddersncZkw0Zs61bMALF3nw0nPa
Received: from igel.home (ppp-46-244-169-244.dynamic.mnet-online.de
 [46.244.169.244])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Mon, 16 Nov 2020 18:59:28 +0100 (CET)
Received: by igel.home (Postfix, from userid 1000)
 id 57F672C3328; Mon, 16 Nov 2020 18:59:28 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
 <83sg99ryla.fsf@HIDDEN>
X-Yow: If elected, Zippy pledges to each and every American
 a 55-year-old houseboy...
Date: Mon, 16 Nov 2020 18:59:28 +0100
In-Reply-To: <83sg99ryla.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 16 Nov
 2020 19:38:41 +0200")
Message-ID: <87o8jx9o8v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org,
 monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

On Nov 16 2020, Eli Zaretskii wrote:

> Sorry, forgot to answer the 'system' part.  The issue there is whether
> calling 'system' (and in general waiting for sub-processes to exit) is
> counted against the process's use of CPU or not.  AFAIK, this is not
> well defined, either.

There's times and getrusage.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:38:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:38:59 2020
Received: from localhost ([127.0.0.1]:57099 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keiSx-0006yZ-DJ
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:38:59 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52968)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keiSu-0006yK-VY
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:38:57 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37702)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keiSp-0005Bh-Li; Mon, 16 Nov 2020 12:38:51 -0500
Received: from [176.228.60.248] (port=3636 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keiSm-0003r0-Mf; Mon, 16 Nov 2020 12:38:50 -0500
Date: Mon, 16 Nov 2020 19:38:41 +0200
Message-Id: <83sg99ryla.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: monnier@HIDDEN
In-Reply-To: <83y2j1rz2f.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 16
 Nov 2020 19:28:24 +0200)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> <83y2j1rz2f.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 16 Nov 2020 19:28:24 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
> 
> > What do you mean by "origin" and by "calling 'system'"?
> 
> Quoting https://pubs.opengroup.org/onlinepubs/9699919799/:
> 
>           The clock() function shall return the implementation's best
>           approximation to the processor time used by the process
>           since the beginning of an implementation-defined era
> 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 	  related only to the process invocation.
> 
> How do you write portable Lisp code that returns consistent results
> based on such shaky foundations?

Sorry, forgot to answer the 'system' part.  The issue there is whether
calling 'system' (and in general waiting for sub-processes to exit) is
counted against the process's use of CPU or not.  AFAIK, this is not
well defined, either.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:28:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:28:41 2020
Received: from localhost ([127.0.0.1]:57075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keiIz-0006hh-5D
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:28:41 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50580)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keiIx-0006hU-Io
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:28:39 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37440)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keiIr-0001fN-MN; Mon, 16 Nov 2020 12:28:33 -0500
Received: from [176.228.60.248] (port=2997 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keiIq-0007NG-AH; Mon, 16 Nov 2020 12:28:33 -0500
Date: Mon, 16 Nov 2020 19:28:24 +0200
Message-Id: <83y2j1rz2f.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Mon, 16 Nov 2020 10:27:29 -0500)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: mattiase@HIDDEN, p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  44674 <at> debbugs.gnu.org,  Philipp Stephani
>  <p.stephani2@HIDDEN>
> Date: Mon, 16 Nov 2020 10:27:29 -0500
> 
> > 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.
> 
> What do you mean by "origin" and by "calling 'system'"?

Quoting https://pubs.opengroup.org/onlinepubs/9699919799/:

          The clock() function shall return the implementation's best
          approximation to the processor time used by the process
          since the beginning of an implementation-defined era
	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  related only to the process invocation.

How do you write portable Lisp code that returns consistent results
based on such shaky foundations?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:17:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:17:32 2020
Received: from localhost ([127.0.0.1]:57046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kei8B-0006PK-Qu
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:17:32 -0500
Received: from eggs.gnu.org ([209.51.188.92]:47832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kei8A-0006P7-N9
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:17:30 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37189)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kei85-0006DK-5c; Mon, 16 Nov 2020 12:17:25 -0500
Received: from [176.228.60.248] (port=2291 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kei83-0003yD-PB; Mon, 16 Nov 2020 12:17:25 -0500
Date: Mon, 16 Nov 2020 19:17:18 +0200
Message-Id: <831rgtte5d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
In-Reply-To: <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
 (message from Philipp Stephani on Mon, 16 Nov 2020 12:46:07 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
 <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
 <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philipp Stephani <p.stephani2@HIDDEN>
> Date: Mon, 16 Nov 2020 12:46:07 +0100
> Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
> 
> > Btw, once this goes in, how about making benchmark-run use it?
> 
> benchmark-run measures walltime, not CPU time

It does now, but we may want to change that.  Does it really make
sense to "benchmark" something using elapsed time?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:16:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:16:01 2020
Received: from localhost ([127.0.0.1]:57041 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kei6j-0006Mb-F5
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:16:01 -0500
Received: from eggs.gnu.org ([209.51.188.92]:47538)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kei6i-0006MO-CJ
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:16:00 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37152)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kei6d-0005m3-3y; Mon, 16 Nov 2020 12:15:55 -0500
Received: from [176.228.60.248] (port=2199 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kei6b-0003sc-It; Mon, 16 Nov 2020 12:15:54 -0500
Date: Mon, 16 Nov 2020 19:15:47 +0200
Message-Id: <833619te7w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <DCB9CD3F-8929-4FC9-8EA2-4A3A14427B51@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 16 Nov 2020 11:53:37 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
 <DCB9CD3F-8929-4FC9-8EA2-4A3A14427B51@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Mattias Engdegård <mattiase@HIDDEN>
> Date: Mon, 16 Nov 2020 11:53:37 +0100
> Cc: Stefan Monnier <monnier@HIDDEN>, 44674 <at> debbugs.gnu.org,
>         Philipp Stephani <p.stephani2@HIDDEN>
> 
> 16 nov. 2020 kl. 11.40 skrev Eli Zaretskii <eliz@HIDDEN>:
> 
> > AFAUI, CLOCK_PROCESS_CPUTIME_ID accounts for all the threads, so might not be what we want even if it is supported, since other threads might be involved which we aren't interested in (e.g., GTK threads).
> 
> CLOCK_THREAD_CPUTIME_ID then. Actually, a case can be made for either timer.

Can you make a case for process-global timing, given that we don't
control all of the threads, and that some of them are utterly
unrelated to timing Lisp programs?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 17:13:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 12:13:23 2020
Received: from localhost ([127.0.0.1]:57033 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kei4B-0006II-CT
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:13:23 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46988)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kei47-0006I4-Oo
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 12:13:22 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37012)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kei41-0004iW-R5; Mon, 16 Nov 2020 12:13:14 -0500
Received: from [176.228.60.248] (port=2035 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kei41-0003W1-5x; Mon, 16 Nov 2020 12:13:13 -0500
Date: Mon, 16 Nov 2020 19:13:05 +0200
Message-Id: <834klptece.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 16 Nov 2020 11:11:34 +0100)
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: p.stephani2@HIDDEN, 44674 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Mattias Engdegård <mattiase@HIDDEN>
> Date: Mon, 16 Nov 2020 11:11:34 +0100
> Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
>         Philipp Stephani <p.stephani2@HIDDEN>
> 
> > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
> 
> Perhaps not ideal to cons in a timing primitive where low overhead is called for.
> What about just returning an integer and have a different way to get at TICKS-PER-SEC?

Why not just return a float in seconds instead?  Do we envision any
application that could be interested in (non-portable) ticks?

> Ideally the returned value should be a fixnum to minimise overhead, but it may restrict the range on 32-bit platforms.

If it must be a fixnum, then it will need to be in nanoseconds, which
would limit its applicability for measuring long intervals.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 16:14:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 11:14:29 2020
Received: from localhost ([127.0.0.1]:56850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keh9A-0002Gd-NC
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 11:14:29 -0500
Received: from mail228c50.megamailservers.eu ([91.136.10.238]:59242
 helo=mail36c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1keh93-0002Fy-LI
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 11:14:27 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1605543259;
 bh=KzzkqutXE3ekq1VVkrQsD+G3KnhzQoJYX+RFFwDWd9g=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=VRmaCNqZ7lLEfqHYKqMr5s960rruMOXwYAu1eTbPeZlwLradFst0XWhv38w0pNWB+
 W5p553Oqx7CZB/9Z+0BH4diNLKHqjJSjWZwyJyTrUSPlOUwJZk/sA2wE/OmbTOm6Bm
 6YuoNyjxnRMbgwYsHOFSrgOvZH66huphugG0eUm0=
Feedback-ID: mattiase@HIDDEN
Received: from stanniol.lan (c-064ae655.032-75-73746f71.bbcust.telenor.se
 [85.230.74.6]) (authenticated bits=0)
 by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0AGGEHnN003571; 
 Mon, 16 Nov 2020 16:14:18 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
Date: Mon, 16 Nov 2020 17:14:16 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <0499BABB-AA02-43FA-89B8-59A7ECD03805@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A782F1B.5FB2A55B.0090, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=Q4ysHL+a c=1 sm=1 tr=0 a=Ni+dBsiEfW2GqKMPYZim9A==:117
 a=Ni+dBsiEfW2GqKMPYZim9A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=iRZporoAAAAA:8 a=l3v9GiYDRwWU5_4XFmwA:9 a=CjuIK1q_8ugA:10
 a=NOBgFS-JBQ2l-kSd6-zu:22
X-Origin-Country: SE
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 44674
Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Philipp Stephani <p.stephani2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

16 nov. 2020 kl. 16.27 skrev Stefan Monnier <monnier@HIDDEN>:

> I expect that the time it takes to perform the `funcall` to get to =
this
> function is itself larger than the time it takes to run `Fcons`, so =
I'm
> not too worried about this overhead.

Perhaps, but the lower the overhead, the shorter the intervals that can =
effectively be measured. It would be a shame to build pointless latency =
into the calling interface from the get-go.

> `make_int` will return a fixnum when possible.  Are you suggesting we
> modulo-truncate the integer so it fits i a fixnum?

As you say it's not worth doing so for 32 bits, but in case a full value =
would require 64 bits, we should at least consider truncating it to 63.

The values returned from clock, clock_gettime etc are generally =
wrapping, which means that the user would need to know how to mask the =
difference in case the timer wraps during a measured interval. This can =
neatly be side-stepped by providing a function for computing the =
duration from two sample points, eg,

 (cpu-time-duration CPU-TIME-1 CPU-TIME-2)

which would apply the necessary modulo-reduction and return the duration =
in seconds as a float. That way, we save the user the trouble to do

 (/ (logand (- CPU-TIME-2 CPU-TIME-1)
            (1- (ash 1 CPU-TIMER-BITS))
    (float CPU-TIMER-FREQ))

and having to retrieve two system constants.

> In my experience measuring CPU or wall clock time for things like
> benchmarks is only meaningful if it's a non-trivial amount of time =
(like
> 0.1s or more), so the added cost of Fcons or allocating a bignum
> is negligible.

Being able to measure short intervals without too much noise can be =
quite useful. Of course, CPU time is sometimes measured with much less =
resolution than real time which sets an effective lower limit; 100 Hz =
used to be the norm but it should be better these days.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 15:27:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 10:27:39 2020
Received: from localhost ([127.0.0.1]:56775 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kegPq-0000P6-Or
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 10:27:38 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50276)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kegPp-0000Ot-H3
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 10:27:38 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3C6F6440A6D;
 Mon, 16 Nov 2020 10:27:32 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 667FE440383;
 Mon, 16 Nov 2020 10:27:30 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605540450;
 bh=tLOPvgsWRwMoxQv3Oby/94/QLqiZHdyPeA1RxBNOpyE=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=C+6M/+yGI66OwtudOZyh1/tlRfAJyNDti+TUMfa0G+UTMRS39xNhbaLY6EkAi7L20
 B001TlXbN1LOS9fZ/zDCZg1a79j8ESjxmAxtDOXqwwgVExDRqB+VhEkQW1DF+3H9rI
 lTBhKt+Cz0LdfdAQbEvCPoMQT1qXwpLd2k6lgBQKsz3yoaynVqwKXAcDURtpnd+q87
 EXqehvwtmbTMNbPoKU7DuEZsk7MW2HrAYjMxDM9pkVzxySCymJOL5wzjAKQ0BnO2Yc
 TMkry7UzluI2qOpWwH1wLdRE781aRuNQXmkLgjAE4/UaMV9Vb9zzGGcxHSa252kDLh
 GJRKOsW+pheSQ==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2E7EE12002C;
 Mon, 16 Nov 2020 10:27:30 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattiase@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
Message-ID: <jwvzh3hjpu3.fsf-monnier+emacs@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
Date: Mon, 16 Nov 2020 10:27:29 -0500
In-Reply-To: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Mon, 16 Nov 2020 11:11:34
 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.069 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Philipp Stephani <p.stephani2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philipp wrote:
> It might be beneficial to use the higher-resolution clock_gettime with
> CLOCK_PROCESS_CPUTIME_ID if available and only fall back to clock()
> otherwise.
>
> While there, consider also implementing a function to read the
> CLOCK_MONOTONIC clock =E2=80=93 that should be preferred over the realtime
> clock for stopwatch-style measurements.

Given that we've lived without any of it for so many years, I'm not sure
it's worth the trouble.  Also since I'm not familiar with any of those
interfaces, I'd welcome it if someone else could do that if
they're interested.

Eli said:
> 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.

What do you mean by "origin" and by "calling 'system'"?

Mattias added:
>> +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
> Perhaps not ideal to cons in a timing primitive where low overhead is
> called for.

I expect that the time it takes to perform the `funcall` to get to this
function is itself larger than the time it takes to run `Fcons`, so I'm
not too worried about this overhead.

> What about just returning an integer and have a different way to get
> at TICKS-PER-SEC?

I designed it this way to keep the change as simple as possible, but
yes, we could have two separate functions.

> Ideally the returned value should be a fixnum to minimise overhead, but it
> may restrict the range on 32-bit platforms.

`make_int` will return a fixnum when possible.  Are you suggesting we
modulo-truncate the integer so it fits i a fixnum?  I think that on
32bit platforms this will lose too much range (I guess we could divide
instead of modulo-truncate, and lose precision instead, tho).  Not sure
it's worth the trouble, tho.

In my experience measuring CPU or wall clock time for things like
benchmarks is only meaningful if it's a non-trivial amount of time (like
0.1s or more), so the added cost of Fcons or allocating a bignum
is negligible.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 11:46:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 06:46:26 2020
Received: from localhost ([127.0.0.1]:55287 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kecxl-0006Y4-Sw
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 06:46:26 -0500
Received: from mail-ot1-f52.google.com ([209.85.210.52]:41319)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1kecxj-0006Ro-Me
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 06:46:25 -0500
Received: by mail-ot1-f52.google.com with SMTP id o3so5150917ota.8
 for <44674 <at> debbugs.gnu.org>; Mon, 16 Nov 2020 03:46:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=XZoerTt4razplaZf5weHaZaBWcOqD5csX1nE7PKjrls=;
 b=JVA0DbPnStz6gGt1yoB9BjJuXMKxbIh8RP7YOqmh/4bGu8T3T9xLWC8wtMmgarc6RG
 HJVwErn28yYo9oeRp3L2N+TeEyecGadvy+5jLNQfrzTts2OYLKBE7zv5UpkgOIAmStUt
 6vMeQ5HJJnkodYPEosTlirByHSa4pJfq5xmrHmq3wP66+VmIDJBZY6ycTg0F93KpCZ2E
 j3ohV5iMCoLuLjaTV0+uuwqYvnLxkWW0UxvdrH36HEOW9zMFrO6vNLL6PnE8uvqvpcaC
 l/7Q1H8ENV/PD62IYQ5MkUxdOXp06CIxktDQQiHnwN1jveeyXCjPBX9xB5q9M9em4Mkv
 cXdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=XZoerTt4razplaZf5weHaZaBWcOqD5csX1nE7PKjrls=;
 b=EszhQh5doznL7X6ClzyeZThfUhqk56snXnT/1iRDgtSek4xbGl3ffThq06hTfJJPpJ
 t0J9Jf+qnVTmhagedm25rfmR3hLaTc/wEFFbIBDjDDaL6NqdQWMhUh9qEqOt+WBrOUtL
 g0WkUiWuOLa5ZN1hjidzDxNhPjRyn2LsdQpWMBn0nFh+6hgVRn7X5f5NDK3QqJGshcvx
 PDqMmoJSm4aE+2azWzU8jAFEZEqcFQBkfU0pfi4FV9P+OXlx+hyCzd+kPtOaIdhMz7+a
 JYHLfGwuB1Fz2AB5N8QoxOCRIuRfGVOJZoLxAa80IMtkgXr9j5RjzAnCf5lNFxnKot9u
 C2tQ==
X-Gm-Message-State: AOAM530knrWt6v7s+8rWHQf5qVqW5Rikfi8HPEci8in+uDYvQAUDf8io
 uk1i0xZ/r9LsfH0mHGu8Jzj/Xo0ETunJ/PQFlpA=
X-Google-Smtp-Source: ABdhPJwBGJNRiB3e2TFVBAueZ3gAQZnxesgeO9X22X8m84N0TqWHhdijhvykAPSwGNewf7XfZbBn9LzynBWeMCsmsAs=
X-Received: by 2002:a9d:d73:: with SMTP id 106mr10072430oti.36.1605527178007; 
 Mon, 16 Nov 2020 03:46:18 -0800 (PST)
MIME-Version: 1.0
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
 <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
In-Reply-To: <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 12:46:07 +0100
Message-ID: <CAArVCkRC_UfAocs1wr9GZjpHW-RN8mMAvG+Z84E--31VuQBRoQ@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 44674
Cc: 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Am Mo., 16. Nov. 2020 um 09:19 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
>
> On November 16, 2020 9:58:40 AM GMT+02:00, Eli Zaretskii <eliz@HIDDEN> wrote:
> > On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier
> > <monnier@HIDDEN> wrote:
> > > Package: Emacs
> > > Version: 28.0.50
> > >
> > >
> > > 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.
> > >
> > > So I suggest we add a new primitive `current-cpu-time` with which
> > > those
> > > tests seem to be at least somewhat doable.
> > >
> > > See my current patch below which includes a test for that
> > > performance bug.  It clearly requires adding w32 support (or
> > > fetching more clock functionality from gnulib) but I don't know how
> > to
> > > do that.
> >
> > 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.
> >
> > I suggest to use 'times' instead.  For w32, we could easily implement
> > it, as we already have that functionality for 'getloadavg'.
>
> Btw, once this goes in, how about making benchmark-run use it?
>

benchmark-run measures walltime, not CPU time, it should use CLOCK_MONOTONIC.
We might consider adding another macro that returns the CPU time (or both).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 10:53:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 05:53:49 2020
Received: from localhost ([127.0.0.1]:55204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kec8q-0003mT-U5
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:53:49 -0500
Received: from mail33c50.megamailservers.eu ([91.136.10.43]:45542)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1kec8l-0003mE-Ak
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:53:48 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1605524020;
 bh=7mTMKPFBZSwZsTJJZyjQx3vOI5JsnFJ4fZOEe/LmKL8=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=LiZVaw9o7iQhHJlGzoO4a3J9b+J302yzWC3fJ6mLYlxQZexzrzBSLQuy0cNX6rIdg
 O61leFuk8MzpUMmdJlkCNcFbb2NqO7UV/QtcKMLZXyHhN83IDKmQYbpfeRvt1Cd0Tf
 7i/AJQkXKF5qYCd0o6ALngSmcTCnFoZWV4zEazBg=
Feedback-ID: mattiase@HIDDEN
Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se
 [188.150.171.71]) (authenticated bits=0)
 by mail33c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0AGArcmj001635; 
 Mon, 16 Nov 2020 10:53:39 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
Date: Mon, 16 Nov 2020 11:53:37 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <DCB9CD3F-8929-4FC9-8EA2-4A3A14427B51@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A782F25.5FB25A34.0079, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=C6KXNjH+ c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117
 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=mDV3o1hIAAAA:8 a=9IrUSoZ6Zvp_DbCrCtoA:9 a=CjuIK1q_8ugA:10
 a=_FVE-zBwftR9WsbkzFJk:22
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 44674
Cc: Philipp Stephani <p.stephani2@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

16 nov. 2020 kl. 11.40 skrev Eli Zaretskii <eliz@HIDDEN>:

> AFAUI, CLOCK_PROCESS_CPUTIME_ID accounts for all the threads, so might =
not be what we want even if it is supported, since other threads might =
be involved which we aren't interested in (e.g., GTK threads).

CLOCK_THREAD_CPUTIME_ID then. Actually, a case can be made for either =
timer.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 10:49:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 05:49:06 2020
Received: from localhost ([127.0.0.1]:55191 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kec4I-0003fk-7L
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:49:06 -0500
Received: from mail-ot1-f44.google.com ([209.85.210.44]:46657)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1kec4B-0003fA-Dp
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:49:05 -0500
Received: by mail-ot1-f44.google.com with SMTP id g19so15499325otp.13
 for <44674 <at> debbugs.gnu.org>; Mon, 16 Nov 2020 02:48:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=kxoCBhDRjkiuuaVO+N19ZUx9yZaHBW6tgzlzUe/bWlA=;
 b=leURvgotbP6UFZo1nFW/+ZBon1tESoI5pEB2Qy0AC8DColJ1P7pHDjLVRGcu6FcI+5
 4yxIoV3IYiRsz5DgFOcI7HSjzo+h8ULIz4TX+23LqhAIAfIc/ZF96HRV/yS6xL/5VJzJ
 qlKPGj8XEr7RRG69BHnBzHX9N5b/lQji+t1bAB4B2DMVflcZy/GeRiZET3Ssgw69ny9u
 W2Wf3rsUUhOXo86p1D0s8ybVqtMSopV4nzkzUxudESEz+VNpBMRVbSwlYSVAkec+vsHb
 RIBg21ZE9E9D95ebi51tFJpOHq3YxswWqCl1ksxeblM3hDthqtuORkxCC1ugYRGNtiX/
 lAYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=kxoCBhDRjkiuuaVO+N19ZUx9yZaHBW6tgzlzUe/bWlA=;
 b=ubWfgP7Y3sQ8chegdnjkR9MtvZrspztRcKXkRTNd/cZ6TOyjqjZvCp1zq6o0vGR4XX
 iDlW7C1ieO4q+GVdYFiusgG/CQJUqCRdR8mEftSWIRMl38u0IPUeu0ArLBHC2UppO7q2
 zqbx/Uz1gA3cwbuxBGp/dRrDy4l1qgHDFwAMOboPXdK9brhLubLcIt9eFrIgbQ9k5Pwe
 UZ2gWEv/uIL6S4NtIphs2qrX3ivXxsiOYXl8XLmoFgBN/DTU4p5MWBazRBqZCi9gsUga
 28DlDPpZIP1Jrf1P6xJ5dUt9eBER7yLmLIEumhv4MuyiGS/wDQiRntEHgi4O9iLoV94M
 QeKw==
X-Gm-Message-State: AOAM533JE9gdDHJfRflmSC5ML7SDiwLEy22WOkWy022Bet0BgLqSxMPj
 qTjXqpO7/+Ss8hoDvNO2uyU80xSc7gi8VlV+jRs=
X-Google-Smtp-Source: ABdhPJwHQZVfjkSE2iYWk+sLoS+CHflf+2wGspfee9qDdjWpaOZ07xWgoVafA+wZhLnwBa7/VYwhvqltsdiO7DAfT5o=
X-Received: by 2002:a9d:72c4:: with SMTP id d4mr10029147otk.149.1605523733602; 
 Mon, 16 Nov 2020 02:48:53 -0800 (PST)
MIME-Version: 1.0
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
 <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
In-Reply-To: <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 11:48:42 +0100
Message-ID: <CAArVCkSA+LRrHOuuJmU+m8wcA1qy0ccf3mtfjV4i7iB50Lw6sA@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 44674
Cc: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 44674 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Am Mo., 16. Nov. 2020 um 11:40 Uhr schrieb Eli Zaretskii <eliz@HIDDEN>:
>
> On November 16, 2020 12:11:34 PM GMT+02:00, "Mattias Engdeg=C3=A5rd" <mat=
tiase@HIDDEN> wrote:
> > > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
> >
> > Perhaps not ideal to cons in a timing primitive where low overhead is
> > called for.
> > What about just returning an integer and have a different way to get
> > at TICKS-PER-SEC?
> > After all, the timer frequency is not specific to each measurement.
> >
> > Ideally the returned value should be a fixnum to minimise overhead,
> > but it may restrict the range on 32-bit platforms.
> >
> > I also agree with Phillipp's comment about clock_gettime.
>
> AFAUI, CLOCK_PROCESS_CPUTIME_ID accounts for all the threads, so might no=
t be what we want even if it is supported, since other threads might be inv=
olved which we aren't interested in (e.g., GTK threads).

clock (on GNU/Linux) is a thin wrapper around
CLOCK_PROCESS_CPUTIME_ID, see
https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/unix/sysv/li=
nux/clock.c;hb=3Daac0f62c47beee5b546bacc330acc2dd21cda0dc.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 10:40:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 05:40:26 2020
Received: from localhost ([127.0.0.1]:55182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kebvu-0003Sm-3c
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:40:26 -0500
Received: from eggs.gnu.org ([209.51.188.92]:33698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kebvr-0003Sa-TL
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:40:24 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60098)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kebvm-00082x-0o; Mon, 16 Nov 2020 05:40:18 -0500
Received: from [2001:4df7:1:ac2::1] (port=43414)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kebvl-0003Ho-02; Mon, 16 Nov 2020 05:40:17 -0500
Date: Mon, 16 Nov 2020 12:40:13 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
References: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: =?ISO-8859-1?Q?Mattias_Engdeg=E5rd?= <mattiase@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <8EE5DC1E-5585-4585-B6E9-58717149ADA6@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
Cc: Philipp Stephani <p.stephani2@HIDDEN>, 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On November 16, 2020 12:11:34 PM GMT+02:00, "Mattias Engdeg=C3=A5rd" <matti=
ase@acm=2Eorg> wrote:
> > +The return value is a pair (CPU-TICKS =2E TICKS-PER-SEC)=2E
>=20
> Perhaps not ideal to cons in a timing primitive where low overhead is
> called for=2E
> What about just returning an integer and have a different way to get
> at TICKS-PER-SEC?
> After all, the timer frequency is not specific to each measurement=2E
>=20
> Ideally the returned value should be a fixnum to minimise overhead,
> but it may restrict the range on 32-bit platforms=2E
>=20
> I also agree with Phillipp's comment about clock_gettime=2E

AFAUI, CLOCK_PROCESS_CPUTIME_ID accounts for all the threads, so might not=
 be what we want even if it is supported, since other threads might be invo=
lved which we aren't interested in (e=2Eg=2E, GTK threads)=2E




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 10:12:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 05:12:40 2020
Received: from localhost ([127.0.0.1]:55147 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kebV1-0002md-Rb
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:12:40 -0500
Received: from mail1466c50.megamailservers.eu ([91.136.14.66]:56260
 helo=mail268c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1kebV0-0002mR-5t
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:12:39 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1605521497;
 bh=567qPT9VrTJ8Totdq6JlzzInLRldxxFe7hYtb47xbd8=;
 h=From:Subject:Date:Cc:To:From;
 b=ewZECvWajgKrKi8SPLBlSX6G3EgyERxAhgseWZf3KCTbk/tzry7tfff4qlr9XgJVT
 3WbbNfVtxiRJxIUcqT8z5o1qV9R+jIBL7mPzG/mrVt5B2dG+l62+Mr0Mn7wWz+v1W+
 9gX8wwe7+gJk+qny4gi81DU1atECHufgiWn5AHf0=
Feedback-ID: mattiase@HIDDEN
Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se
 [188.150.171.71]) (authenticated bits=0)
 by mail268c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0AGABZ0h005696; 
 Mon, 16 Nov 2020 10:11:36 +0000
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests 
Message-Id: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
Date: Mon, 16 Nov 2020 11:11:34 +0100
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A782F17.5FB25059.009D, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=RLDN4Lq+ c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117
 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=8I9lPxhjOZPvdVvDmeAA:9 a=CjuIK1q_8ugA:10
X-Origin-Country: SE
X-Spam-Score: 3.8 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
 Perhaps not ideal to cons in a timing primitive where low overhead is called
 for. What about just returning an integer and have a different way to get
 at TICKS-PER-SEC? After all, the timer frequency [...] 
 Content analysis details:   (3.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 2.4 FAKE_REPLY_B           No description available.
 0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 44674
Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Philipp Stephani <p.stephani2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
    Perhaps not ideal to cons in a timing primitive where low overhead is called
    for. What about just returning an integer and have a different way to get
    at TICKS-PER-SEC? After all, the timer frequency [...] 
 
 Content analysis details:   (2.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
  2.4 FAKE_REPLY_B           No description available.

> +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).

Perhaps not ideal to cons in a timing primitive where low overhead is =
called for.
What about just returning an integer and have a different way to get at =
TICKS-PER-SEC?
After all, the timer frequency is not specific to each measurement.

Ideally the returned value should be a fixnum to minimise overhead, but =
it may restrict the range on 32-bit platforms.

I also agree with Phillipp's comment about clock_gettime.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 10:11:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 05:11:50 2020
Received: from localhost ([127.0.0.1]:55142 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kebUE-0002lB-He
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:11:50 -0500
Received: from mail1466c50.megamailservers.eu ([91.136.14.66]:55942
 helo=mail268c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1kebU9-0002ks-76
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 05:11:48 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1605521497;
 bh=567qPT9VrTJ8Totdq6JlzzInLRldxxFe7hYtb47xbd8=;
 h=From:Subject:Date:Cc:To:From;
 b=ewZECvWajgKrKi8SPLBlSX6G3EgyERxAhgseWZf3KCTbk/tzry7tfff4qlr9XgJVT
 3WbbNfVtxiRJxIUcqT8z5o1qV9R+jIBL7mPzG/mrVt5B2dG+l62+Mr0Mn7wWz+v1W+
 9gX8wwe7+gJk+qny4gi81DU1atECHufgiWn5AHf0=
Feedback-ID: mattiase@HIDDEN
Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se
 [188.150.171.71]) (authenticated bits=0)
 by mail268c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0AGABZ0h005696; 
 Mon, 16 Nov 2020 10:11:36 +0000
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests 
Message-Id: <C161C9BA-8FCE-4845-A67E-6A6A1871CB3D@HIDDEN>
Date: Mon, 16 Nov 2020 11:11:34 +0100
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A782F17.5FB25059.009D, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=RLDN4Lq+ c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117
 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=8I9lPxhjOZPvdVvDmeAA:9 a=CjuIK1q_8ugA:10
X-Origin-Country: SE
X-Spam-Score: 3.8 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
 Perhaps not ideal to cons in a timing primitive where low overhead is called
 for. What about just returning an integer and have a different way to get
 at TICKS-PER-SEC? After all, the timer frequency [...] 
 Content analysis details:   (3.8 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 2.4 FAKE_REPLY_B           No description available.
 0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 44674
Cc: Eli Zaretskii <eliz@HIDDEN>, 44674 <at> debbugs.gnu.org,
 Philipp Stephani <p.stephani2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
    Perhaps not ideal to cons in a timing primitive where low overhead is called
    for. What about just returning an integer and have a different way to get
    at TICKS-PER-SEC? After all, the timer frequency [...] 
 
 Content analysis details:   (2.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
  2.4 FAKE_REPLY_B           No description available.

> +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).

Perhaps not ideal to cons in a timing primitive where low overhead is =
called for.
What about just returning an integer and have a different way to get at =
TICKS-PER-SEC?
After all, the timer frequency is not specific to each measurement.

Ideally the returned value should be a fixnum to minimise overhead, but =
it may restrict the range on 32-bit platforms.

I also agree with Phillipp's comment about clock_gettime.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 08:18:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 03:18:51 2020
Received: from localhost ([127.0.0.1]:55004 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keZit-0008Mj-GM
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 03:18:51 -0500
Received: from eggs.gnu.org ([209.51.188.92]:54550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keZiq-0008ME-Dl
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 03:18:48 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58256)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keZik-0006NZ-Qu; Mon, 16 Nov 2020 03:18:42 -0500
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 <eliz@HIDDEN>)
 id 1keZij-0007Dw-2G; Mon, 16 Nov 2020 03:18:42 -0500
Date: Mon, 16 Nov 2020 10:18:36 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: bug-gnu-emacs@HIDDEN,44674 <at> debbugs.gnu.org,monnier@HIDDEN
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On November 16, 2020 9:58:40 AM GMT+02:00, Eli Zaretskii <eliz@gnu=2Eorg> w=
rote:
> On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier
> <monnier@iro=2Eumontreal=2Eca> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 08:18:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 03:18:48 2020
Received: from localhost ([127.0.0.1]:55001 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keZiq-0008MT-8E
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 03:18:48 -0500
Received: from lists.gnu.org ([209.51.188.17]:55830)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keZim-0008MG-G2
 for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 03:18:47 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:54648)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1keZil-000245-G5
 for bug-gnu-emacs@HIDDEN; Mon, 16 Nov 2020 03:18:44 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58256)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keZik-0006NZ-Qu; Mon, 16 Nov 2020 03:18:42 -0500
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 <eliz@HIDDEN>)
 id 1keZij-0007Dw-2G; Mon, 16 Nov 2020 03:18:42 -0500
Date: Mon, 16 Nov 2020 10:18:36 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
References: <jwveekujei0.fsf@HIDDEN>
 <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: bug-gnu-emacs@HIDDEN,44674 <at> debbugs.gnu.org,monnier@HIDDEN
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <1BDDC2C4-2831-460F-AC48-C353664D28D2@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On November 16, 2020 9:58:40 AM GMT+02:00, Eli Zaretskii <eliz@gnu=2Eorg> w=
rote:
> On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier
> <monnier@iro=2Eumontreal=2Eca> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 07:58:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 02:58:56 2020
Received: from localhost ([127.0.0.1]:54936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keZPc-0007kw-Bh
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:58:56 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48860)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keZPa-0007kV-P2
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:58:55 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57952)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keZPT-0007c8-Vu; Mon, 16 Nov 2020 02:58:48 -0500
Received: from [2001:4df7:1:ac2::1] (port=42918)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keZPS-0003Cc-5g; Mon, 16 Nov 2020 02:58:47 -0500
Date: Mon, 16 Nov 2020 09:58:40 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <jwveekujei0.fsf@HIDDEN>
References: <jwveekujei0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 44674 <at> debbugs.gnu.org
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier <monnier@iro=2Eum=
ontreal=2Eca> 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

AFAIU, using 'clock' here is not the best idea, as there are caveats wrt t=
o calling 'system', and the origin of the returned value is not well define=
d to be portable=2E

I suggest to use 'times' instead=2E  For w32, we could easily implement it=
, as we already have that functionality for 'getloadavg'=2E




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 07:58:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 02:58:53 2020
Received: from localhost ([127.0.0.1]:54933 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keZPZ-0007kg-2K
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:58:53 -0500
Received: from lists.gnu.org ([209.51.188.17]:43910)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1keZPV-0007kX-Vz
 for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:58:51 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:48956)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1keZPV-0003IV-Nr
 for bug-gnu-emacs@HIDDEN; Mon, 16 Nov 2020 02:58:49 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57952)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1keZPT-0007c8-Vu; Mon, 16 Nov 2020 02:58:48 -0500
Received: from [2001:4df7:1:ac2::1] (port=42918)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1keZPS-0003Cc-5g; Mon, 16 Nov 2020 02:58:47 -0500
Date: Mon, 16 Nov 2020 09:58:40 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <jwveekujei0.fsf@HIDDEN>
References: <jwveekujei0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 44674 <at> debbugs.gnu.org
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <ED4DFA8C-40A0-4F67-8C4F-EA94FCEEDBAC@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On November 16, 2020 3:07:35 AM GMT+02:00, Stefan Monnier <monnier@iro=2Eum=
ontreal=2Eca> 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

AFAIU, using 'clock' here is not the best idea, as there are caveats wrt t=
o calling 'system', and the origin of the returned value is not well define=
d to be portable=2E

I suggest to use 'times' instead=2E  For w32, we could easily implement it=
, as we already have that functionality for 'getloadavg'=2E




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at 44674 <at> debbugs.gnu.org:


Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 07:13:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 02:13:52 2020
Received: from localhost ([127.0.0.1]:54905 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keYi0-0006aK-MP
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:13:52 -0500
Received: from mail-oi1-f173.google.com ([209.85.167.173]:36273)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.stephani2@HIDDEN>) id 1keYhw-0006a5-To
 for 44674 <at> debbugs.gnu.org; Mon, 16 Nov 2020 02:13:51 -0500
Received: by mail-oi1-f173.google.com with SMTP id d9so17775467oib.3
 for <44674 <at> debbugs.gnu.org>; Sun, 15 Nov 2020 23:13:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=Qo65oDIXFPmDhuE/uNww/49zDfA33vSXps1/oNay3Fw=;
 b=FvtL9JD+S0VbMAuIQoMvVHu+evhwtSMkcKwFHL/DpPIdOIXukgBdZquy7ussIa2beU
 IPPUqq3KMEjE21bVbmIksyA1HuoV/R1gC/FuxjhrVKelgDoogercVIjRvz3yisljrUWy
 w3S4NhnbkpGvts4oULFGjxRBb8sLjzUqnT/IxaASSZP+5H7jtmUcXKXTJhY2PRmTcDuA
 6eRta5vH5UITm2qW09cmBq4G+AUa94HyjYU1WGRuuQWNblQYu6BSgV+MOQ0lAui9w5s8
 GortfOq7tDQWqj9NiCHvoKFyZZfa0Agz7Qfsg8HHYtD4LPKfYUX/xL86lu0Qb5mCGUKe
 4Zfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=Qo65oDIXFPmDhuE/uNww/49zDfA33vSXps1/oNay3Fw=;
 b=Iq0b/irhl29f8JQiti7km8NOV/huqUJe6hE8wMBMGdGw4nwtJWs410kWmuE91OrxUL
 d9vea3TfPAS7lsFq7K3YxnGrzDzPbO/yUurqi9emunb1HCD96F49Sy2cRYWXuqXGgAc9
 y21AeSBx8MqYey1mpY0jg4O5MJjkFDFilffH6EBdmmboV313VoJzb3JeEkxDr6ntVY2o
 BBbnJs7WCVfXbNP3HaLCBwHUNCEl7hKEkL/pMC13mHFK5Th9xpuXvnI4rm9sJSBP5Lp2
 0AGKZLm5+bXavclGpDKT18yFLXr5H1UoO9GQ96g5QklMbMtP6DLO82BpgDC5YbMoBfLO
 +GUw==
X-Gm-Message-State: AOAM533h9mLnUVCFJiq3V0yjhgLsuIBaLl8Ogqk1BdCkMPv1nUAb65Br
 UxhortXbLWmgqssbldUuYqtH6H0sErLNdByike8=
X-Google-Smtp-Source: ABdhPJyKywCTGelzwYOrCmhll5vaK07tnHsIQgwOaDGFy/yIlmsdWMPucEnBhLodncHJ7ZHwlboTMS71eZ9wZeax6Hw=
X-Received: by 2002:a05:6808:3af:: with SMTP id
 n15mr9060834oie.65.1605510823206; 
 Sun, 15 Nov 2020 23:13:43 -0800 (PST)
MIME-Version: 1.0
References: <jwveekujei0.fsf@HIDDEN>
In-Reply-To: <jwveekujei0.fsf@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Mon, 16 Nov 2020 08:13:32 +0100
Message-ID: <CAArVCkRQEsNFCTpCngDDAU2LUPrRYcBnEEn8=EmX95EL8RFTmw@HIDDEN>
Subject: Re: bug#44674: 28.0.50; Adding current-cpu-time for performance tests
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 44674
Cc: 44674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Am Mo., 16. Nov. 2020 um 02:08 Uhr schrieb Stefan Monnier
<monnier@HIDDEN>:

> +#ifdef CLOCKS_PER_SEC
> +DEFUN ("current-cpu-time", Fcurrent_cpu_time, Scurrent_cpu_time, 0, 0, 0=
,
> +       doc: /* Return the current CPU time along with its resolution.
> +The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
> +The CPU-TICKS counter can wrap around, so values cannot be meaningfully
> +compared if too much time has passed between them.  */)
> +  (void)
> +{
> +  return Fcons (make_int (clock ()), make_int (CLOCKS_PER_SEC));
> +}
> +#endif

Looks useful!

It might be beneficial to use the higher-resolution clock_gettime with
CLOCK_PROCESS_CPUTIME_ID if available and only fall back to clock()
otherwise.

While there, consider also implementing a function to read the
CLOCK_MONOTONIC clock =E2=80=93 that should be preferred over the realtime
clock for stopwatch-style measurements.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 01:07:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 15 20:07:57 2020
Received: from localhost ([127.0.0.1]:54647 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1keSzs-0005YQ-OR
	for submit <at> debbugs.gnu.org; Sun, 15 Nov 2020 20:07:57 -0500
Received: from lists.gnu.org ([209.51.188.17]:34850)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1keSzn-0005YB-81
 for submit <at> debbugs.gnu.org; Sun, 15 Nov 2020 20:07:54 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:43626)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1keSzn-0000zS-3b
 for bug-gnu-emacs@HIDDEN; Sun, 15 Nov 2020 20:07:51 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20405)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1keSzk-0000pP-JM
 for bug-gnu-emacs@HIDDEN; Sun, 15 Nov 2020 20:07:50 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2465780479
 for <bug-gnu-emacs@HIDDEN>; Sun, 15 Nov 2020 20:07:47 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B793C804C9
 for <bug-gnu-emacs@HIDDEN>; Sun, 15 Nov 2020 20:07:45 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605488865;
 bh=Iiid9XedPwtXEUZzwj48ixFnF69SMFhvYJrjL1rmGEI=;
 h=From:To:Subject:Date:From;
 b=IDFbzzDpOQwOwEcEUlPaFZVSBblCq2V/8nonIGb0BJzO5eK4DDs11vlrBgWZZqGh3
 YVIye6KKeTVBX+PlVqd7o2drnOc0hnnjORc3wkJMwKcD6p1SvektgOvZHrtHrJfxdB
 a6r8U57DgzvK25jaMzgCpWETsIztugvB4u7itbHUIdAC8F4+CsZr61TcOoiSFquWnU
 NDTNIDTHhqBZPALMHMMNdl2gDiS9Pld0tNdvLnbW2Pb7UhRy3hPvTRNu4jA0FYG9PN
 L+sA/DYCZiuIzduG0VLwX8Ct4VFqkRb/hDMZVzYGy+8zV/N+OMnmt6vWahdzOBE+sV
 c+MpOanEXm2Jg==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 965C41202E3
 for <bug-gnu-emacs@HIDDEN>; Sun, 15 Nov 2020 20:07:45 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Adding current-cpu-time for performance tests
Date: Sun, 15 Nov 2020 20:07:35 -0500
Message-ID: <jwveekujei0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.074 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 17:01:16
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Package: Emacs
Version: 28.0.50


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.

So I suggest we add a new primitive `current-cpu-time` with which those
tests seem to be at least somewhat doable.

See my current patch below which includes a test for that
performance bug.  It clearly requires adding w32 support (or
fetching more clock functionality from gnulib) but I don't know how to
do that.


        Stefan


diff --git a/etc/NEWS b/etc/NEWS
index f21c4cb02c..703fbf5243 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1733,6 +1733,11 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
 
 * Lisp Changes in Emacs 28.1
 
+---
+** New function 'current-cpu-time'.
+It gives access to the CPU time used by the Emacs process, for
+example for benchmarking purposes.
+
 +++
 ** 'define-globalized-minor-mode' now takes a ':predicate' parameter.
 This can be used to control which major modes the minor mode should be
diff --git a/src/timefns.c b/src/timefns.c
index 4a28f707a3..b569c6d075 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1793,6 +1793,18 @@ DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
   return make_lisp_time (current_timespec ());
 }
 
+#ifdef CLOCKS_PER_SEC
+DEFUN ("current-cpu-time", Fcurrent_cpu_time, Scurrent_cpu_time, 0, 0, 0,
+       doc: /* Return the current CPU time along with its resolution.
+The return value is a pair (CPU-TICKS . TICKS-PER-SEC).
+The CPU-TICKS counter can wrap around, so values cannot be meaningfully
+compared if too much time has passed between them.  */)
+  (void)
+{
+  return Fcons (make_int (clock ()), make_int (CLOCKS_PER_SEC));
+}
+#endif
+
 DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string,
        0, 2, 0,
        doc: /* Return the current local time, as a human-readable string.
@@ -2032,6 +2044,9 @@ syms_of_timefns (void)
   DEFSYM (Qencode_time, "encode-time");
 
   defsubr (&Scurrent_time);
+#ifdef CLOCKS_PER_SEC
+  defsubr (&Scurrent_cpu_time);
+#endif
   defsubr (&Stime_convert);
   defsubr (&Stime_add);
   defsubr (&Stime_subtract);
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index ed09203907..fc57271252 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -381,6 +381,36 @@ binding-test-set-constant-nil
   "Test setting a keyword to itself"
   (with-no-warnings (should (setq :keyword :keyword))))
 
+(ert-deftest data-tests--set-default-per-buffer ()
+  :expected-result t ;; Not fixed yet!
+  ;; FIXME: Performance tests are inherently unreliable.
+  ;; Using wall-clock time makes it even worse, so don't bother unless
+  ;; we have the primitive to measure cpu-time.
+  (skip-unless (fboundp 'current-cpu-time))
+  ;; Test performance of set-default on DEFVAR_PER_BUFFER variables.
+  ;; More specifically, test the problem seen in bug#41029 where setting
+  ;; the default value of a variable takes time proportional to the
+  ;; number of buffers.
+  (let* ((fun #'error)
+         (test (lambda ()
+                 (with-temp-buffer
+                   (let ((st (car (current-cpu-time))))
+                     (dotimes (_ 1000)
+                       (let ((case-fold-search 'data-test))
+                         ;; Use an indirection through a mutable var
+                         ;; to try and make sure the byte-compiler
+                         ;; doesn't optimize away the let bindings.
+                         (funcall fun)))
+                     (- (car (current-cpu-time)) st)))))
+         (_ (setq fun #'ignore))
+         (time1 (funcall test))
+         (bufs (mapcar (lambda (_) (generate-new-buffer " data-test"))
+                       (make-list 1000 nil)))
+         (time2 (funcall test)))
+    (mapc #'kill-buffer bufs)
+    ;; Don't divide one time by the other since they may be 0.
+    (should (< time2 (* time1 5)))))
+
 ;; More tests to write -
 ;; kill-local-variable
 ;; defconst; can modify





Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44674; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 16 Nov 2020 22:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.