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 20:17:19 +0300 Message-ID: <83pnaieme8.fsf@gnu.org> References: <83y2p6epp5.fsf@gnu.org> 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="35440"; 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 19:18:11 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 1jfo4g-00094B-Fu for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 19:18:10 +0200 Original-Received: from localhost ([::1]:54976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfo4f-0000NS-In for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 13:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfo4Y-0000MC-3C for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 13:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfo4X-0007DT-QD for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 13:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfo4X-0002JL-Lp for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 13:18:01 -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 17:18: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.15910318508841 (code B ref 41646); Mon, 01 Jun 2020 17:18:01 +0000 Original-Received: (at 41646) by debbugs.gnu.org; 1 Jun 2020 17:17:30 +0000 Original-Received: from localhost ([127.0.0.1]:36911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfo42-0002IX-KD for submit@debbugs.gnu.org; Mon, 01 Jun 2020 13:17:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfo41-0002IJ-1k for 41646@debbugs.gnu.org; Mon, 01 Jun 2020 13:17:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52735) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfo3v-00075d-Qv; Mon, 01 Jun 2020 13:17:23 -0400 Original-Received: from [176.228.60.248] (port=3670 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jfo3v-0002FO-58; Mon, 01 Jun 2020 13:17:23 -0400 In-Reply-To: (message from Nicolas =?UTF-8?Q?B=C3=A9rtolo?= on Mon, 1 Jun 2020 13:46:01 -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:181353 Archived-At: > From: Nicolas BĂ©rtolo > Date: Mon, 1 Jun 2020 13:46:01 -0300 > Cc: 41646@debbugs.gnu.org > > > 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? > > Exactly, but not nearly as bad. I profiled the same Spacemacs configuration in > Ubuntu 20.04 and startup takes 10 seconds, with 5 seconds spent inside openp(). > > Compare this to 40 seconds in total and 32 seconds inside openp() in Windows. You may be surprised how many users of GNU/Linux consider 5 sec during startup an unacceptable slowdown. > > 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? > > They come from openp(), yes. I haven't tried it. I think the issue is related to > the IO architecture in Windows, so I don't expect major speedups, but it could > certainly help. 'chmod' doesn't access the file, it only accesses the directory. So it could be much faster. > > My main concern with a cache is how to make sure it reflects what's on > > the disk, when files are added or removed. > > That is my main concern as well. A good option would be to rely on package.el to > generate the load-cache.el file for a package when it generates autoloads. If we > can't find any of the files mentioned in the cache then we fallback to the > current load-path code. That is a simple solution that would take care of > addition and removal of files, I think. Is this supposed to work only when packages are installed by package.el? What about manual installation?