From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 8e2b2a2: Minor cleanup in pdumper.c Date: Sat, 19 Jan 2019 14:41:04 -0800 Organization: UCLA Computer Science Department Message-ID: References: <20190119182259.26893.32117@vcs0.savannah.gnu.org> <20190119182301.0DE562043D@vcs0.savannah.gnu.org> <034912a4e687ae39bfc17b45ec6a9ef7.squirrel@dancol.org> <4508562eb2e3fe5fedd01263f6c39d5c.squirrel@dancol.org> <176c3ec3-7c6a-8f89-b31c-66c8cd129339@cs.ucla.edu> <65893773f79082a62d6654c818979479.squirrel@dancol.org> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------65FC91B06A771BA4945247F6" X-Trace: ciao.gmane.org 1547937684 162070 195.159.176.228 (19 Jan 2019 22:41:24 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sat, 19 Jan 2019 22:41:24 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 19 23:41:22 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1gkzIo-000g99-Ki for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 23:41:22 +0100 Original-Received: from localhost ([127.0.0.1]:60777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkzIx-0000Kj-Cp for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 17:41:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkzIp-0000Ig-Ue for emacs-devel@gnu.org; Sat, 19 Jan 2019 17:41:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkzIo-0004Nk-12 for emacs-devel@gnu.org; Sat, 19 Jan 2019 17:41:22 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37512) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkzIi-0004I4-Fp for emacs-devel@gnu.org; Sat, 19 Jan 2019 17:41:17 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D79CA1610E2; Sat, 19 Jan 2019 14:41:10 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id a72wHVhtY1Np; Sat, 19 Jan 2019 14:41:05 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C97281610BC; Sat, 19 Jan 2019 14:41:04 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nQ4vjuYbJOgU; Sat, 19 Jan 2019 14:41:04 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9068B160D13; Sat, 19 Jan 2019 14:41:04 -0800 (PST) In-Reply-To: <65893773f79082a62d6654c818979479.squirrel@dancol.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232513 Archived-At: This is a multi-part message in MIME format. --------------65FC91B06A771BA4945247F6 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Daniel Colascione wrote: > No reason in particular. We can always change it. OK, thanks, I did that by installing the attached. (One of my pet little peeves is avoiding rounding errors, admittedly overkill here.) --------------65FC91B06A771BA4945247F6 Content-Type: text/x-patch; name="0001-pdumper-stats-now-returns-s-not-ms.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-pdumper-stats-now-returns-s-not-ms.patch" >From 7b82c1efa10b249191be51a9bc001a345b26ce2e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 19 Jan 2019 14:38:52 -0800 Subject: [PATCH] pdumper-stats now returns s, not ms * doc/lispref/internals.texi (pdumper-stats): * src/pdumper.c (pdumper_load): Return seconds, not milliseconds. Minimize rounding errors in the usual case. --- doc/lispref/internals.texi | 2 +- src/pdumper.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 437657f243..06ff9f70bf 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -232,7 +232,7 @@ Building Emacs @w{@code{((dumped-with-pdumper . t) (load-time . @var{time}) (dump-file-name . @var{file}))}}, where @var{file} is the name of the dump file, and @var{time} is the -time in milliseconds it took to restore the state from the dump file. +time in seconds it took to restore the state from the dump file. If the current session was not restored from a portable dump file, the value is nil. @end defun diff --git a/src/pdumper.c b/src/pdumper.c index 19a21329b1..4bbeabb828 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5545,9 +5545,10 @@ pdumper_load (const char *dump_filename) struct timespec load_timespec = timespec_sub (current_timespec (), start_time); - dump_private.load_time = - (double) load_timespec.tv_sec * 1000.0 - + (double) load_timespec.tv_nsec * 0.000001; + ALLOW_IMPLICIT_CONVERSION; + double s = load_timespec.tv_sec, ns = load_timespec.tv_nsec; + DISALLOW_IMPLICIT_CONVERSION; + dump_private.load_time = (s * 1e9 + ns) / 1e9; dump_private.dump_filename = dump_filename_copy; dump_filename_copy = NULL; @@ -5569,7 +5570,7 @@ the return value is an alist of the form: ((dumped-with-pdumper . t) (load-time . TIME) (dump-file-name . FILE)) -where TIME is the time in milliseconds it took to restore Emacs state +where TIME is the time in seconds it took to restore Emacs state from the dump file, and FILE is the name of the dump file. Value is nil if this session was not started using a portable dump file.*/) (void) -- 2.17.1 --------------65FC91B06A771BA4945247F6--