From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41646: Startup in Windows is very slow when load-path contains many entries. Date: Mon, 01 Jun 2020 19:05:58 +0300 Message-ID: <83y2p6epp5.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121621"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41646@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 18:07:12 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 1jfmy0-000VYO-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 18:07:12 +0200 Original-Received: from localhost ([::1]:45034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfmxz-0001aj-53 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 12:07:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfmxr-0001aa-EE for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfmxq-0000FM-62 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfmxq-0000UE-1A for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41646 X-GNU-PR-Package: emacs Original-Received: via spool by 41646-submit@debbugs.gnu.org id=B41646.15910275661808 (code B ref 41646); Mon, 01 Jun 2020 16:07:01 +0000 Original-Received: (at 41646) by debbugs.gnu.org; 1 Jun 2020 16:06:06 +0000 Original-Received: from localhost ([127.0.0.1]:36823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfmww-0000T6-9p for submit@debbugs.gnu.org; Mon, 01 Jun 2020 12:06:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfmws-0000SU-1N for 41646@debbugs.gnu.org; Mon, 01 Jun 2020 12:06:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51608) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfmwm-00008u-Ra; Mon, 01 Jun 2020 12:05:56 -0400 Original-Received: from [176.228.60.248] (port=3020 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jfmwl-0002ns-PC; Mon, 01 Jun 2020 12:05:56 -0400 In-Reply-To: (message from Nicolas =?UTF-8?Q?B=C3=A9rtolo?= on Mon, 1 Jun 2020 11:26:35 -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:181345 Archived-At: > From: Nicolas BĂ©rtolo > Date: Mon, 1 Jun 2020 11:26:35 -0300 > > I have an issue regarding startup times in Windows. My configuration is > Spacemacs with many layers enabled. My load-path contains 380 entries. > > I have profiled Emacs in Windows and found that it spends most of the startup > time calling wopen(). This is because when calling (load "foo") it checks all > directories in load-path for ("foo.el" "foo.elc" "foo.el.gz" "foo.elc.gz" > "foo.dll"). It gets worse when load-prefer-newer is t. > > In my case `load-path` contains 380 entries, so every call to load will perform > 380 * 5 = 1900 calls to wopen. This is very slow in Windows because its > filesystem is not optimized for so many accesses to small files. So this is not specific to Windows, it's just that Windows has slower file access. IOW, if load-path becomes significantly larger, the slow startup will show on Posix systems as well, right? Next question: are the 'wopen' calls coming from 'openp'? if so, perhaps we could first try a cheaper call, like 'chmod' (or its Win32 API equivalent), and save the 'wopen' call if 'chmod' fails? Did you try that? > I thought that a caching mechanism would help. My main concern with a cache is how to make sure it reflects what's on the disk, when files are added or removed. Thanks.