From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#41242: Port feature/native-comp to Windows - Reduce the number of files probed when finding a lisp file. Date: Mon, 01 Jun 2020 07:21:31 +0000 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="ciao.gmane.io:159.69.161.202"; logging-data="91921"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 41242@debbugs.gnu.org To: Nicolas =?UTF-8?Q?B=C3=A9rtolo?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 09:22:10 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 1jfelt-000Noi-Th for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 09:22:09 +0200 Original-Received: from localhost ([::1]:41380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfelt-0008H2-06 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 03:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfelm-0008GQ-14 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 03:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfell-0004jm-Ol for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 03:22:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfell-00060J-Jh for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 03:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 07:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41242 X-GNU-PR-Package: emacs Original-Received: via spool by 41242-submit@debbugs.gnu.org id=B41242.159099609423046 (code B ref 41242); Mon, 01 Jun 2020 07:22:01 +0000 Original-Received: (at 41242) by debbugs.gnu.org; 1 Jun 2020 07:21:34 +0000 Original-Received: from localhost ([127.0.0.1]:34385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfelK-0005zd-0O for submit@debbugs.gnu.org; Mon, 01 Jun 2020 03:21:34 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:65337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfelI-0005zU-1R for 41242@debbugs.gnu.org; Mon, 01 Jun 2020 03:21:32 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 0517LVCF017947 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 1 Jun 2020 07:21:31 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 0517LV8g012720; Mon, 1 Jun 2020 07:21:31 GMT In-Reply-To: ("Nicolas =?UTF-8?Q?B=C3=A9rtolo?="'s message of "Sun, 31 May 2020 19:41:36 -0300") 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:181328 Archived-At: Nicolas B=C3=A9rtolo writes: > Last night I came up with a fresh idea to properly solve the problem with= slow > loads. Considering that it happens when `load-path` contains hundreds of > directories I thought that a caching mechanism would help. > > This "cache" would consist of a mapping of files that would get probed wh= en > (load "foo") runs. It would be implemented as a hash table. This could get > stored in `package-user-dir` and package.el would be in charge of updatin= g it > when installing or removing packages, just like autoloads. > > The contents of this hash table could be something like this: > > The directory company-20200525.101 could have a file load-cache.el with: > > company -> ("company-20200525.101/eln-hash/company.eln" > "company-20200525.101/company.el" > "company-20200525.101/company.elc") > [...] > > The directory helm-20200517.509 could have a file load-cache.el with: > > helm -> ("helm-20200517.509/eln-hash/helm.eln" > "helm-20200517.509/helm.el" > "helm-20200517.509/helm.elc") > [...] > > When `load-path` changes we could update the in-memory hash table by load= ing all > the load-cache.el files. > > Then, when (require 'foo) runs, the loading code could look at the hash > table and only fopen() the files associated with the feature we are loadi= ng. > This would reduce the number of calls to fopen() from thousands to ~3 in = the > worst case. > > Of course, this feature would be disabled by default. > > What do you think? Hi Nico, could you recall me why this is specific to the native-comp branch? Isn't this a problem that should affect any Emacs on Windows? Thanks Andrea --=20 akrl@sdf.org