From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master afc0bfd380: Speed up loaddefs-generate on slow disks Date: Sat, 04 Jun 2022 15:01:50 +0200 Message-ID: <87ee047fb5.fsf@gnus.org> References: <165416120601.23485.9799765950267646757@vcs2.savannah.gnu.org> <20220602091326.514E9C009A8@vcs2.savannah.gnu.org> <87a6avccs4.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6013"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Paul Eggert To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 04 15:04:05 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nxTRl-0001K8-0r for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Jun 2022 15:04:05 +0200 Original-Received: from localhost ([::1]:55330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxTRj-0005Y7-R9 for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Jun 2022 09:04:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxTPo-0004a5-Dv for emacs-devel@gnu.org; Sat, 04 Jun 2022 09:02:04 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:35570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxTPm-0000hW-CZ for emacs-devel@gnu.org; Sat, 04 Jun 2022 09:02:03 -0400 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=2S6H3PDHBK7L33AsmI2c7hKXHmkQKbtJGPnO2GZHv6g=; b=NsNurqSo0R4KOXzhsU7v4G58Wx oPE2ypmCaryY2kOEwsDC+IcsNaFPV9P8s/85HYQmfle/Ibnx+ZKOf9we8yC01x6N/XlfuppBSX5Ba y7UUVmzkzsmy6kPJhfC9+LKVCuQwJxwM/m8HndCBeGn3l0BubMNjQsuAzafqz3bLjz5I=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxTPd-0004nP-6R; Sat, 04 Jun 2022 15:01:55 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUPDxInHCONbKxO KEOiOy3///9uRwijAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YGBAw1FyQTjt0AAAGlSURBVDjLpZNh mqMwCIbh6R4AxAOsZA4gkAO0mvufaUk6M9raf8uPqLx8BAkB+G9DZiY6vpl/QaIDYLEkmA40PoOb aiG4/e1axFMqdFUCfN9wWmCO+A07FF6wHXJkW79fdaGGcNryJ0QXvCP4+gmswG7v4KaZCFivCg+T 2q4AoC5Sd71uPredUK4AYvrKDpVrpy0bslzjYX508OFoNkbxxwfQcvnzAcwje7sWuw3XdH/zCzde 8zznB9tJ5CAzZb8ni7oTUJ8RxhXZgTM55TnDfO/eCBZfOY+TmxsHO0sfD9UOTRaE1vwrYtOwaoxf zVjUpoVBS4R6aEQsnL0Jm8oAHl5105yrnsSTh1rk+Eno0zL+Vlt0VckoiAGiuJqI1j3qpsWLQd84 N8j+lmAte6L82hp0l46lKGW0L2WEgfZUuw8Vieoj/zHzOvQ6m0VUcqMMshyw4iFQIr3ELBRMWRAT S+nXKPhpQsYkcUwj/9j7UOPTO4alL3CSjEf22T4oXi7kGfQrzG/kW5ANfSXS0mysO13AHn2NFwkP V9Sk9lIA15OCjuL+AZFuUILiwA2mAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA2LTA0VDEyOjUz OjIzKzAwOjAwf9+2egAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNi0wNFQxMjo1MzoyMyswMDow MA6CDsYAAAAASUVORK5CYII= X-Now-Playing: 1CD (2022) - 02 Water Mirror's _Illusion_: "(Circle Of Whispers)" In-Reply-To: <87a6avccs4.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Jun 2022 17:20:43 +0200") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290651 Archived-At: Lars Ingebrigtsen writes: >> Maybe `file-newer-than-file-p` should accept a time value for one of the >> two file names so we can speed this up further by refraining from >> constructing a whole `file-attributes` only to reduce it down to >> a single boolean? > > There's a longer discussion about these issues (i.e., reworking the > functions in this area to be more efficient in these respects) in the > bug tracker somewhere. Paul had a bunch of ideas that I think we should > pursue. I forget which bug# -- perhaps Paul remembers; added to the CCs. It's bug#55163, but to recap shortly (hehe) for new readers: Our time functions return time values on a very inefficient format (a four-element list), and we want to move (long term) to a more efficient format (which is a single cons cell). But we can't just change the output from our current time functions, because that breaks a lot of callers. But we can introduce new functions that only return the efficient format. My point in bug#55163 is that we should see this as an opportunity to overhaul functions in this area in general, and `file-attributes' is one of those. For instance, we could have a new function `file-attribute' where you specify the data you actually want, like (file-attribute file :modtime), and it'd just return that value. (Or more values if you say (file-attribute file :modtime :directoryp) etc.) If we had that, our loop here would have been (time-less-p output-time (file-attribute file :modtime)) and it would be maximally fast and efficient. So I don't think we should touch `file-newer-than-file-p' in any way, but instead wait for this new set of functions (which should be created in one go so that everything fits together, and not piecemeal). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no