From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lin Sun Newsgroups: gmane.emacs.bugs Subject: bug#41646: Startup in Windows is very slow when load-path contains many Date: Fri, 1 Nov 2024 16:56:59 +0000 Message-ID: References: <86r08luqsq.fsf@gnu.org> <86frp1unvu.fsf@gnu.org> <86y12stv24.fsf@gnu.org> <86set0th9d.fsf@gnu.org> <86iktwt49w.fsf@gnu.org> <86cyk4t2su.fsf@gnu.org> <86a5f8t0sf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38591"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , acorallo@gnu.org, 41646@debbugs.gnu.org, stefankangas@gmail.com, monnier@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 01 17:59:24 2024 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 1t6uzc-0009rp-16 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Nov 2024 17:59:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6uzN-0007bD-6a; Fri, 01 Nov 2024 12:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6uzH-0007Zn-9C for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2024 12:59:06 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6uzG-0004b6-Dr for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2024 12:59:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=AeUD+p30slxojxy2rgvaoBNjrP3LoKARmsyLR7b/cMc=; b=hWzRWBWO0x0GGNel9AMz/0KdFKCRq8v4P+u/nuYSWfuogTPXe392Sk0u4RKISx+PX+E0uORINmFrY6yL44VVcdkBs6vV8sIColJBipMNwoiEI168RskDFfgVtzcBgtrqJtFHyQwlTrM1qZUxbDsUif0y4+oDoAxKDm+7DqW5uOwbVXBPVINeCuiznUKqff54uE2hGsRoCkkHkLtlN+A0bJch8CveyRZOfNMXHHacZS1prQ/aeez+Nw41ioqAS8MEFCK3lchzub6Eym+NxZMcy8wa2nbOdpHI6TGfdhZMP6O8F7cK5UfLwizkGeksZ6mXYA83LEn6Y3q4vDA9RAqfuA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6uzG-0007WB-9O for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2024 12:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lin Sun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Nov 2024 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 41646-submit@debbugs.gnu.org id=B41646.173048029528872 (code B ref 41646); Fri, 01 Nov 2024 16:59:02 +0000 Original-Received: (at 41646) by debbugs.gnu.org; 1 Nov 2024 16:58:15 +0000 Original-Received: from localhost ([127.0.0.1]:50640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6uyU-0007Vc-Fq for submit@debbugs.gnu.org; Fri, 01 Nov 2024 12:58:14 -0400 Original-Received: from mail-ed1-f53.google.com ([209.85.208.53]:54363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6uyS-0007VW-HB for 41646@debbugs.gnu.org; Fri, 01 Nov 2024 12:58:13 -0400 Original-Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5cb74434bc5so2556844a12.0 for <41646@debbugs.gnu.org>; Fri, 01 Nov 2024 09:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730480231; x=1731085031; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AeUD+p30slxojxy2rgvaoBNjrP3LoKARmsyLR7b/cMc=; b=IlYUCh3AEAA8kjkoFUnggzJupBjRxc2XCKHfkwx9UhpgEO+1HRw95uY3Xo4rk/1PWA IsdGtFoMxieNMxPmIGiWstBtWMSEzCxzTdlwoiEGXABr/FgSoTfWzChzatnRQHRKDe/V 4OaLMtgL/TTnVT4sVAV7aw487lPoLH8Fg086g8i2MO10WpxR2PHPJhp1vXpohU8ymcWb cG6Ia1fxtmjVOYN6suceVxCRxybq9Zo7T2xo1YFXgZPhNCKZ4Um0B6PBs5BSje8KfSsa IFRcyXLZ2J9/toilwjgR73lG5ZLX0IMFxPoOVmaKEC7CC4Yw5Q34cUa4cyStHcPFUf9V hRrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730480231; x=1731085031; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AeUD+p30slxojxy2rgvaoBNjrP3LoKARmsyLR7b/cMc=; b=Eiqyf8DHkv0BQkYfHBXU/S+8jKNNPLfAD6xviDspuVkmlxUR+bBdDSP/jdilv11hfB IPHv9qhYkv0VwrR9en3xC77ekun+XsBfGcgz3+MteYpmT7Y1qe6JtmWu/3QEHJIrIo/U pE/hIb21mnJTDwNuS5lMydoIkC2mX2tmZsMucph2ptpLYsb1WtqVgXru08HwBlViBRuX /pQSJAajc4QveuJOOp6FWyxq4VCE15lq4oGwqDqTNbFYOqsLXRmMwBSKSpJFORlff5ls C9/ugttio20ZIFkARRj10JpMTXOQMshGj5nRU1ou1zocCns1Kc5TBjHmqg5um3dc12O6 Mgog== X-Forwarded-Encrypted: i=1; AJvYcCUcZU16BT8VjUCfBkoz7zlrMekNiZEzMxhSNBKT9uaz8MAC5nrWrv/v67nWnadiRMa/zwbwZQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyPeoPwnHQh08p0ybfMk41NffsY4MNpMCjsQJGV6ysqf7bFxibo wYZ4iKmkKrxVUGgXA0aCr3iZQOQAkyjqHHVb7SK35UHN2+oR7v0GJqtfzRMoXlQPlmdVjZtIBwT vQdN2skSlAQB+eURCArsFyEU6Sg4= X-Google-Smtp-Source: AGHT+IGY9WPXO+7rdqry50M1I+r11lt7mQ2+E/U4ZCyvHVge5gjR+9QeDN2jnFy885h6g0QSFoXRZcPgN4hFbwAC9n0= X-Received: by 2002:a05:6402:50c8:b0:5cb:7318:800d with SMTP id 4fb4d7f45d1cf-5ceb936ae32mr2496448a12.32.1730480231146; Fri, 01 Nov 2024 09:57:11 -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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294692 Archived-At: On Fri, Nov 1, 2024 at 8:17=E2=80=AFAM Eli Zaretskii wrote: > ... > How will the '"file1" "file2" ...' part be created? For the Emacs built in paths, we can create the ( [files]) during bootstrap and write to the "subdirs.el", then it will push the extended (, files...) into `load-path'. On Fri, Nov 1, 2024 at 1:11=E2=80=AFPM Stefan Monnier wrote: > > > Yes, introducing this new variable will increase the complexity to the > > end user. > > Exactly, and I think we should first try to solve the problem without > exposing the user to such complexity. > ... > >> and then `load` can use `load-prefix-trim-load-path` to iterate on > >> a much shorter `load-path`. > > Note that this above proposal should be transparent to the end user (tho > it requires extra work on the `package.el` side): e.g. funny changes > to `load-path` would be handled without fuss. > > >> I'm not completely sure if it's a good idea, tho: I'd really prefer > >> a solution that doesn't require any change to any package management > >> code, which instead uses a cache (updated/filled automatically) of all > >> the files found in all the `load-path` directories. > > If that, we have to track the file/path changes in each entry of > > load-path, it may not be possible for all the supported OSs. > > We can easily detect changes to `load-path` itself, of course, but as > for changes to the content of the directories in `load-path` that would > be more difficult&costly, admittedly. My plan was to do nothing > about it (i.e. allow the cache to go stale): if we use the cache only to > tell `load` in which directory to look for the file, it should usually > be safe because IME it's rare for files to be added/removed from > directories such that it changes from which directory a given ELisp file > is loaded. But of course we could also make efforts to try and keep our > cache consistent, e.g. via OS-level notification infrastructure or > by flushing the cache after a N seconds. Agree the changes are difficult and costly. The inotify way is hard to work on all OSes, and the cache need very carefully maintenance policy.