From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#44674: 28.0.50; Adding current-cpu-time for performance tests Date: Mon, 16 Nov 2020 19:39:35 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6960"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 44674@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 16 20:14:37 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kejxU-0001h6-P4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Nov 2020 20:14:36 +0100 Original-Received: from localhost ([::1]:41606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kejxT-0006uR-R3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Nov 2020 14:14:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kejQ3-0003Pu-De for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 13:40:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kejQ2-0000Ob-7R for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 13:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kejQ2-0008VZ-40 for bug-gnu-emacs@gnu.org; Mon, 16 Nov 2020 13:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Nov 2020 18:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44674 X-GNU-PR-Package: emacs Original-Received: via spool by 44674-submit@debbugs.gnu.org id=B44674.160555199332683 (code B ref 44674); Mon, 16 Nov 2020 18:40:02 +0000 Original-Received: (at 44674) by debbugs.gnu.org; 16 Nov 2020 18:39:53 +0000 Original-Received: from localhost ([127.0.0.1]:57194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejPt-0008V5-1h for submit@debbugs.gnu.org; Mon, 16 Nov 2020 13:39:53 -0500 Original-Received: from mail-oo1-f49.google.com ([209.85.161.49]:46205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejPr-0008Us-Vs for 44674@debbugs.gnu.org; Mon, 16 Nov 2020 13:39:52 -0500 Original-Received: by mail-oo1-f49.google.com with SMTP id c25so4124608ooe.13 for <44674@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) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193461 Archived-At: Am Mo., 16. Nov. 2020 um 16:27 Uhr schrieb Stefan Monnier : > > 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