From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Volf Newsgroups: gmane.emacs.help Subject: How to speed up ido-use-filename-at-point 'guess on large directories Date: Fri, 27 Oct 2023 22:58:17 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d1CoNHdugZo2bOVm" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25099"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 28 12:41:14 2023 Return-path: Envelope-to: geh-help-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 1qwgkk-0006N2-1C for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Oct 2023 12:41:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwgkR-0003Wg-0e; Sat, 28 Oct 2023 06:40:55 -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 1qwTuY-0006NH-Ly for help-gnu-emacs@gnu.org; Fri, 27 Oct 2023 16:58:30 -0400 Original-Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwTuV-000633-O7 for help-gnu-emacs@gnu.org; Fri, 27 Oct 2023 16:58:29 -0400 Original-Received: by wolfsden.cz (Postfix, from userid 104) id C6758274712; Fri, 27 Oct 2023 20:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1698440302; bh=ILAzdG+qqv5vDWfnS+lXdfI+p55vQAQspwA/YMriXcQ=; h=Date:From:To:Subject; b=JdA2nZfj82NBvFU7YmQW5dnddu79hx2l+zCKhTsGnjRWNAD3H6SOfcgLn/5ckQLoi t97tKrxoGGvR0ZCmyWxt9pZAEj75PfejHwdOINz8AIJwXismfa0Gz7SV1aZ4qenNke r/hHz2SNXPJpFybNbMFQwn9s3Ul67FEhKyxMu8QNgX8nQPxr6FlFAy+7xLiTaS89XI CyG859F4l63x169hyIOA8GICTAjdrHQTfJLx0b7sCeFvP8yBxZSCiV5RsxGBwcq6gu wcFVB5ovPSlshEzKzBjxi1bL2MyUM5SODfcTBFGcPGXyujffvn76uIvRC04mVdOXZp 8ln7MSCW0Dvj6YXZBxzqv1OAHtrQ+34OfdtIPuqbUsyfpBN2+cAIxoFvTyM//zQo4x 67ubeNuCkuVhLIUjVVk+j2HVky5Yav6BzKZhMXT8FvwPg5gSXIFbqmGrvenxJmUomp yzJLvsbGwu/0m7Du+qTY/o5arUIAUV8qVLdB0Dbeu6eXuh6PwBs/7pfAUJPsEnSJM+ non0peLnyPI8csVXv28VljbA+Q/Lf1yzI1ToRHbD6GmT9sWwy84R22d1i01We8sA32 0lNm50xnF8v9sF6Z53dMRuAFRECVCMlxmwgW/Ik1lVftNFYtWdpy7ahG+Kya5DzXR3 jQyyKj2WtLlm84fSzKQ+bTWI= Original-Received: from localhost (unknown [193.32.127.144]) by wolfsden.cz (Postfix) with ESMTPSA id 1AC8B274DA9 for ; Fri, 27 Oct 2023 20:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1698440299; bh=ILAzdG+qqv5vDWfnS+lXdfI+p55vQAQspwA/YMriXcQ=; h=Date:From:To:Subject; b=wZ2pNuaN91ZPns+FzuV0LoF3c0dOOpEra/35Fz68tLFmcZoV2GmJSozpit/W6bPHq CDz3/s44cNfdg+KSna1IhkwuWa+q95YyJeCnBsy1jhyQrQYNZUVcFt7LjRuSBYETwb u+/MRR4r93d3/4WcSyC1M2lCws3Bz6EbRpJN9K1s1XJtkh7xxntVgBDcEvynuBuU/Q 3o215+5waOzTitC0BMMbCg5j7ZYK4uyBlQvtW6PiJkXrC8sKJ8NnZeziZya4pr5EU7 jnx/s1OnPdpYfPFxym2ybsPCdpHdmPx3UcHsMxCo4MPmb5rnV6DcEqqq35+rzTnYaR hDOfe24n2PBWHG/G/dIx1f70JMvcOf9KY17N9z4rVDz5smrywWwoGavAlfJy4mzZiN DTrFrUugm3bOVtpBqySZRtVfSVOPgqzRbysF77VxeyhkdFrCkE8qTOks7zrLvmZifV wgY+5xtpUvKxNecUiwk2ChDWDMth4n2n4NU18baMf7mLvcSEjSpMrPSDwx2QjccjTY NiTHm+56IgGQkYhYp3OBjaxT2V/iCoCZ1Os7E4N5aX9KLkbXNkWQ9SuTJRthr6bsmV VRDDNVUCIXkhZ6VojXIEJPKbI5jHNsYKNJkTnkukiapp9TQhuxOc2iUcDGqDSsORUF GvL4i7RC1QrtyoSjnAxTPe28= Original-Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 4041e4e5 for ; Fri, 27 Oct 2023 20:58:17 +0000 (UTC) Content-Disposition: inline Received-SPF: none client-ip=37.205.8.62; envelope-from=ws@wolfsnet.cz; helo=wolfsden.cz X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 28 Oct 2023 06:40:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145403 Archived-At: --d1CoNHdugZo2bOVm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I ran into an issue of C-x C-f being very slow when guessing the filename at point if the file at point is located in a large directory (119765 entries). My ido configuration: (require 'ido) (setq ido-enable-flex-matching t ido-enable-dot-prefix t ido-max-prospects 8 ido-everywhere t ido-auto-merge-work-directories-length -1 ido-create-new-buffer 'always ido-use-filename-at-point 'guess) (ido-mode 1) I did manage to find ido-big-directories variable, so I also added this: (add-to-list 'ido-big-directories (rx "/gnu/store")) That does seem to work, because trying to navigate into /gnu/store does tel= l me [Too big]. However when I have a point over a filename inside the /gnu/store, for exam= ple /gnu/store/a1252v3fav1fabl1qmbzyjl936prabir-foo, the ido-find-file takes a = long time (many seconds) before showing the prompt (with the file at point filled in). #emacs did advice me to use toggle-debug-on-quit, so I do have a backtrace: Debugger entered--Lisp error: (quit) #f(compiled-function () #)() ido-ignore-item-p("gi4q3azbf5akkn2lwzqwk7w9zbb23xps-pyfuse3-3.2.1.tar= =2E.." ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./") t) #f(compiled-function (name) #)("gi4q3az= bf5akkn2lwzqwk7w9zbb23xps-pyfuse3-3.2.1.tar...") ido-make-file-list-1("/gnu/store/") ido-make-file-list(nil) ido-read-internal(file "Find file: " ido-file-history nil confirm-aft= er-completion "a1252v3fav1fabl1qmbzyjl936prabir-foo") ido-file-internal(raise-frame) ido-find-file() funcall-interactively(ido-find-file) command-execute(ido-find-file) It seems to be building a list of the files, I somewhat hoped the ido-big-directories would prevent that. Would someone have any idea how to make this faster? Thank you and have a nice day, Tomas Volf --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --d1CoNHdugZo2bOVm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmU8JGkACgkQL7/ufbZ/ wakxTQ//S9j5KOe8wzdTQF4VFLWD41NOOyy8eQ/u33Lq/+/dreu1kMGR2DIhWP9x CjCarOPrmkzpXza5TqstzgH3AJ+dWuT0MwaeGFFuYgICokMxtq3XDS8LIiW7aVcL amoXnV8xwLzUclR6ADJfGwXSd/xMEcrM+lm3eTsO6CXXynaC0HKeafLOlWVQS+4B aaoAvcEmh/x6pkjyReaRhYrTADR5ZszPRc5GwaQ7OKP6+Vm6Gb6utrCKf+exgKnf hNbTxyU9Ivy7s8ZpiNm4hh7HNu6o8mD2H+jxcpAJLRzb3wq6pSQl3nB79nagCljl Qkbujge0BmSGCx1RzQSuoG/3kdjAkdFKPFFnEsJBBbiuKr6bwFuuCxSDJ2ibEQcD oYZR3pZHHc3HfD28UXOYH/9VOutn8U4z8KYiNDsQk6HyBRvkSui4WCpWXkCniO90 sroOEJ4seFdVeelcWgGCKk1Qkr+U5CoK+nGT4OMthaG/uiG5/uAvcqtMpie8IBn4 WEP17Ta0JpaJcVFkPyLLjYfUZj1Qw5GHxZtKJ0KHp4E1DFZiVB4Ufk7uFTa8o5Vx vxZTKJnK8UDWkmg3a6buSwuAtEC/MxLD8vHqr2QCNJfhhZkIaiM5rDyu1M2R8a3F CL6/zwbQqsVzx8SX1UC4rGNp7MkBRiw+pH88VvtGgKAYpBDSCLE= =CMnz -----END PGP SIGNATURE----- --d1CoNHdugZo2bOVm--