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#41646: Startup in Windows is very slow when load-path contains many entries. Date: Mon, 1 Jun 2020 13:46:01 -0300 Message-ID: References: <83y2p6epp5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41646@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 18:47:17 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 1jfnak-0008JT-BP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 18:47:14 +0200 Original-Received: from localhost ([::1]:40096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfnaj-0000AK-Bw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 12:47:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfnaY-0000AA-5d for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfnaX-00019S-SV for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfnaX-0001Uu-Qd for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 12:47: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 16:47: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.15910299795702 (code B ref 41646); Mon, 01 Jun 2020 16:47:01 +0000 Original-Received: (at 41646) by debbugs.gnu.org; 1 Jun 2020 16:46:19 +0000 Original-Received: from localhost ([127.0.0.1]:36869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfnZr-0001Tu-7f for submit@debbugs.gnu.org; Mon, 01 Jun 2020 12:46:19 -0400 Original-Received: from mail-oi1-f174.google.com ([209.85.167.174]:37253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfnZp-0001Th-Jp for 41646@debbugs.gnu.org; Mon, 01 Jun 2020 12:46:18 -0400 Original-Received: by mail-oi1-f174.google.com with SMTP id m67so9425897oif.4 for <41646@debbugs.gnu.org>; Mon, 01 Jun 2020 09:46:17 -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; bh=B9LpKHXnrNU7b+8To/EsEWaUtmcyxbei/pAPT4Gt9Cc=; b=nqzOfiNSvdkQfGT9YXrrt3DpM4H2xTZHPUBiaMtJHjTLLupCIL5N6M9swsA6yjgXWc ZASrN1XaTqPct68qMMtbrpQSHxsQ1wlI6BJH/DxbLBSlrdWhwq1mDg/EDaUITADJ+Q/D kdXzwj5FjrAjk9/wWl4GGDZNnkK5Bb8JHxA4tjAClc/GPT+QYrySaWzJRnoXot1IN9Us F+dH1syUBb4GILdmT9qVslAKNZdNAoEF71OSa6wLkCQJ6i0A0kFYpQFKR+qN7ffCEcNj Vleb6bA2a0SW7EhjMn+qSC6GW3hNylTGqNFvDfA4uY23kJFSYACZkOlEzvzq2VnN+Eyd s5zg== 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; bh=B9LpKHXnrNU7b+8To/EsEWaUtmcyxbei/pAPT4Gt9Cc=; b=iTGSElhZsHHtoTlDQjOm/GRzPMZoK3FOgInNpZ+2yvYXQM9sSojt5ERhoEDHDmPvcJ o16iLjqTw6OgbBpKESjDgBKoEBhjE2XCjJOrGvGx2KKPMrC/jgoKDbRY58JZjBJ4DmhZ ywymeJnExaR7IcINC0EraQd6RnW0TPFHf0M31L79/GvEkyBIhiy6d595eWkm5WIYdEBv 9ZzdHAHCs/makO6b9NcOqGBNhSgyjocJxRj4tEPuGlGNTOoz5SFFczsP+z4AYd3HeKgP EjWjDHoYSzDXxM+mkgq9eDN6BZFRskHRR/Q8GZlqbxuoPZkLVhPa2TFqEDtV/3LVNC6s ugMQ== X-Gm-Message-State: AOAM533omEZS2D5n927VlHPNO6v9bOqhZGKalMdCi1jSZQ7UwRKbaeqi BKinhsDbKINvlblkWA4VvZBK73Rn9sMu3uC6JB6M9P7L+do= X-Google-Smtp-Source: ABdhPJwt0TCN2nUUvLRgzTazbDsuHwfszyzJiNEYP3xYQF3e6lt0jhF6VBGD9PP1NKXq303ZP/WR1lcW2YPHbn+iQKw= X-Received: by 2002:a54:4701:: with SMTP id k1mr156423oik.175.1591029971837; Mon, 01 Jun 2020 09:46:11 -0700 (PDT) In-Reply-To: <83y2p6epp5.fsf@gnu.org> 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:181352 Archived-At: > 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. > 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. > 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. Nico.