From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Nicolas =?UTF-8?Q?B=C3=A9rtolo?= 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, 1 Jun 2020 10:56:27 -0300 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="78546"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41242@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 15:57:07 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 1jfkw7-000KK8-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 15:57:07 +0200 Original-Received: from localhost ([::1]:44730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfkw6-0006Ej-D2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 09:57:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfkw2-0006EY-5C for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 09:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfkw1-0003Cu-Se for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 09:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfkw1-0005mY-Re for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 09:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas =?UTF-8?Q?B=C3=A9rtolo?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 13:57: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.159101981422212 (code B ref 41242); Mon, 01 Jun 2020 13:57:01 +0000 Original-Received: (at 41242) by debbugs.gnu.org; 1 Jun 2020 13:56:54 +0000 Original-Received: from localhost ([127.0.0.1]:36674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfkvl-0005m4-EM for submit@debbugs.gnu.org; Mon, 01 Jun 2020 09:56:54 -0400 Original-Received: from mail-ot1-f48.google.com ([209.85.210.48]:34569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfkvj-0005ls-Lc for 41242@debbugs.gnu.org; Mon, 01 Jun 2020 09:56:43 -0400 Original-Received: by mail-ot1-f48.google.com with SMTP id b18so8044403oti.1 for <41242@debbugs.gnu.org>; Mon, 01 Jun 2020 06:56:43 -0700 (PDT) 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=+U+QpU5UlfQHEjBT0fluCCLBlC9+3nwtEFTw49NfZps=; b=GHykdLSgaQFCJ6m+3Sx1NiDWsgN38RwA4IphvWUekXI5/dZuxoHCBvLINgwEtSvJ24 ksrjV/aEf1OSamtBqMOtf9TYbR9YiPp45XMvaBDsHT26FE70aG3zj4cvQ4NxRX/xKLsU cEn9zZOFQFfq1VFEYDRt9OEZoDYTZTPqKA/IyuqNaNkQ52viT0NFMs4OniWuYmFXfXpu gYQOqetXeMU8C3yL/Dqx9TW39hsiYSQZjcy92lG8QBbP7EZ+K8TexYjjNDBjqFfJ2ffA sAMqd99KDcGyMHeVZHc7G81T6H2LLbvbYjwTSQW4uLYiLhW6rDaoyWo0Ws7/AqmaN4ql Ax3A== 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=+U+QpU5UlfQHEjBT0fluCCLBlC9+3nwtEFTw49NfZps=; b=N2+xzUcmW2FNjK50qTfXvJlr3420DWhfyigthDGwTPYA4UUcocEaJsab0+mywh9wRN CFcsbRLG86THMgClnlZ4KtJaj+g6SXbvw+BSJV8VfZJzsEpV+IaYMQ+H7Mne301uC02P r6tHpkU7cizT4l02u8kisvumxJWZtOtj2mFX/N1+jtjFU/YD7XFJ3j7l5h5NTkUgXWSF T+r8VzrBvKvNmEb64dry/9iK3XMAkhumQmZi0tCaI1Y2lQVlXMJHxQlZpZ/kJElzibHR SUaS2W9uIEPDCW2kP1KErCwP6Eipuqz/hDu/38n986tVTZ02ZyVuY2IYlu5bpnc/Qgbh 4YfA== X-Gm-Message-State: AOAM530wm7J2mCRzd7meOrhS20WHDCI5IgluTibUgP8wlSJd56LQUX+f sLbN5Ttvqo5jmhL+MinhYZcsYm4/Putqm+VGAqA= X-Google-Smtp-Source: ABdhPJzKXVb3DktDFxo3DU9Ee/8bJqWSWi5R4a5p3C4Ok93EdWtVDg3faWRQWhtJlxSLX5PmFk/C4DnNS8j5Q52iPVI= X-Received: by 2002:a9d:4c19:: with SMTP id l25mr14117511otf.193.1591019797799; Mon, 01 Jun 2020 06:56:37 -0700 (PDT) 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:181336 Archived-At: > Isn't this a problem that should affect any Emacs on Windows? You are right. I will open a separate bug. Nico El lun., 1 jun. 2020 a las 4:21, Andrea Corallo () escribi=C3= =B3: > > Nicolas B=C3=A9rtolo writes: > > > Last night I came up with a fresh idea to properly solve the problem wi= th slow > > loads. Considering that it happens when `load-path` contains hundreds o= f > > directories I thought that a caching mechanism would help. > > > > This "cache" would consist of a mapping of files that would get probed = when > > (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 updat= ing 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 lo= ading 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 loa= ding. > > This would reduce the number of calls to fopen() from thousands to ~3 i= n 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 > > -- > akrl@sdf.org