From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Christopher M. Miles" Newsgroups: gmane.emacs.help Subject: How to improve the speed of files list reading under directory in completion Date: Sun, 07 Nov 2021 00:12:53 +0800 Message-ID: Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22538"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.0; emacs 28.0.60 To: Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 06 17:24:46 2021 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 1mjOUo-0005gO-IW for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 17:24:46 +0100 Original-Received: from localhost ([::1]:48924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjOUn-0002p8-Dc for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 12:24:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjOUO-0002p0-K2 for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 12:24:20 -0400 Original-Received: from mail-db8eur05olkn2080b.outbound.protection.outlook.com ([2a01:111:f400:7e1a::80b]:12129 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjOUL-0008Fo-D2 for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 12:24:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PXxbejVHED5SWsxJJjOzHthNShmkSuGwxPu3VS8dztVNPNg6+qKbl/ikRwwh9yN3AgylCR7pDwEfIqIfrPS3MnvWjsK7TYJIngUiNydE8TwtwbDMnKrnO8rUoEg2sC61nd45PaAFnQbos1TUIRDQrnxb0MTUJM9/IsQeiTcfQanNoPPaQwlzFZgAEft7jKOcSDL8RDUCQE72qZIVCoZ4JloHX1Q6k167GRrJUmxJ4dgwxLRM295MxCM2rbvrW98658E7HxH+jEGYsvAAuA6vr+oBIhzGqdwF+9LrzbEq6bCa1l6h26ndaUI7ZgrrvCno+CfD2WSllg4sUHRqwG/OEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wmtIcetFdbci8BcZmN8ytNz0598FoVRsxv6UgD9f0jA=; b=axe8uK2Jggux9j9cbrOp4DN457/XbyEammBTGM2O8P9CMvyUL7w3CUDSCSoIEXHTDbXQ12aMgD3+V3HQr4YZBXGKE0xlotbqDkUjDaKg8VxMmMTCAX2vsGftu2CTDrvCmPB22g0Zz8sGVl/zDLJ70pzCX4FPNd7FeemVbNwV6Q36fftgg5/6oDUfjnwnGGREKNAi+T+RiWzGPzu+r0vlIuMS2JHWNkBKmdaKg+H9jVWZLM5zO/79XQBFnj+d31nYT+n17ZzFDbj1N0YK2fU8Bh4iAjAPlMcJZ/aMTs8JgSmro1e6tATNdEaMcD9wBDGEncxNQpbhimQYduk05IsHEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wmtIcetFdbci8BcZmN8ytNz0598FoVRsxv6UgD9f0jA=; b=MWY+VJ8S0rvkz8rAw/yMwKWfZTTta79y+NUVZGtBw7OLtByMy82TfxZh3cxGC8OyCtcolgpDNRA8EKvD/xp6iIQRi8Vr342XfMqI/mywvXT2uiUG9D16kI0OoGdc5pYmJnv+JF/j+xpBUy5R7Hx0NkOtoaCqcuqoRVj2ttoAgohcaoretlD5uUJIOPNPntklmlK8pBbbMji4Z2Qtc4qM8nwqGoEaHHj+qizHUIWWBTrOcPdcSQgd7fyD9axfjtJVNT9hwV4bg+B7/BqfSbMe+q9upj8ovVy7+XLVwdrVTpLJQOzZome0wwmkb2yOBXykZS/I5PyR1X41N3iLbPaKxg== Original-Received: from PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) by PA4PR08MB5886.eurprd08.prod.outlook.com (2603:10a6:102:e2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Sat, 6 Nov 2021 16:19:12 +0000 Original-Received: from PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::90c1:4e36:aaac:49d0]) by PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::90c1:4e36:aaac:49d0%5]) with mapi id 15.20.4649.020; Sat, 6 Nov 2021 16:19:12 +0000 X-TMN: [xYZdndc56/SSiCzAiOnCIr2xPTR4QgTUPdIWDpfWND4=] X-ClientProxiedBy: HK2PR03CA0049.apcprd03.prod.outlook.com (2603:1096:202:17::19) To PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) X-Microsoft-Original-Message-ID: X-MS-Exchange-MessageSentRepresentingType: 2 Original-Received: from Mac-mini.local (183.246.145.175) by HK2PR03CA0049.apcprd03.prod.outlook.com (2603:1096:202:17::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.7 via Frontend Transport; Sat, 6 Nov 2021 16:19:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1d990ad-8ff9-4c5f-10b5-08d9a1412b2b X-MS-TrafficTypeDiagnostic: PA4PR08MB5886: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2sQzxJwz4/YL9eTLUPkmRk220wC1rbEXR4Wk4wDJr5tTFVqblo9EbIpf+3d1MsFUop0ZzWEKqI80MNJwRq+Of2LMfQ2iGWswI1EnLDwb9Y0T18XX0LmuMXm7bzbbfck+AIq5J+nZIGzmvwfsAkdCxW2o70jhbPVR6s6ryOJi7j5gR8NLeSckJM7VsMmXzSFGq4SdS0b4ki24Ax0EB3BPl7Qhws/NdmXKZQhq1xlzxgTWz8AQbItPgU8gHQYxPr+HKZioiqNO+ZiZQrgoT8HU+w6s8Ll1wJf8RzkEDvCPEoSAmATwsUED4Vay2Eq5fSeG+bbAhYLc8myRue0ZqOBy0wNzM2o9plVBxy5Rl32zm3M1Ru6P5CS1VLIIs4x2UbZbj0X1q91wuWuX7PUk+XVMLJYQ2f5UMk3ZMOtRW5QTUi8FqjiwEVkm/ajxvGPThKRdi6bXl0b3TIIXu4WbY3O2NDJeK1yKNkrWTc1mmNa1HIXcp1lDYNOqgw74RoYzpkzPzGfyYAB/ZkZyfBBfa+U1thpz1NA59Rks56afjpq8ilzIlj5inzXloO7JLBj1lnMVVOqlAo+MnjTBZxVV8SBiPA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JsDCML70VVqnBUUMronaV+X5sX88VhYBWAqvBbVksQ349nAoib2100y4U27okDselrqt3nm2xU0O2r2wUV33zf7HbGB7gsztftSVwKkWGYBJGby0N7uH8z5j6lLPZYcqKIm27GCEcuZ63eXyf9fmC4wwHHQpHvgyoM6dhtpZsOAC7g/mLtbGJ4mCDx0heEGLHvy2iU0egw4tIZjFFHNFOEUE/A0QeM9EXY7Hw+4dpqT0pgmwaIP+DBbQEPFWZT5jnhrz37nGCibvse3WjidJOlJnwTEgsX0Fj/ox83J2zhyYZOTlX3InaaErhwBd3fWtH3yJ3Ll/kfnuqzQyrJ5IwBGtqYhPddNqWf8c5Cp5IZjFes1r4dlAL/3GNc+nVi2MpFeY8R0RmvEajpjRc41HqlYBEYB9dKxTMbVBUJG8ueX9NJVKR93bMyv1ez0216+xVDHwaA3zuGdxP57pVqI7o3+8GzDYP/IFgG4ROVi2saAMXVSq0AjHp4vVHAZNgy4DttIAV/2+XHtp5jjD1YvaCOpFvR8F9EOdqgAR0hHXq7vI03NWimzAdBCzSAHgcG5GKfnzLDlNLmb2IkiPC6iutXpMHp2qvuSffKkoE5nsXY83zCwlwAk2qI3GFp8ym+/RZRYN4OiAqejsQnq1ERXLaKOs9762zxXue/LVqADYs/J47Fn0QKspHKrIvEV7/MJOZiM1B8ugLuxn8odkhlBFig== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1d990ad-8ff9-4c5f-10b5-08d9a1412b2b X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6640.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2021 16:19:12.4061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5886 Received-SPF: pass client-ip=2a01:111:f400:7e1a::80b; envelope-from=stardiviner@outlook.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MSGID_FROM_MTA_HEADER=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.help:134416 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I'm using =3Dvertico=3D and =3Dmarginalia=3D to get minibuffer completion. When I press =3D[C-x C-f]=3D to try to open a file under current directory = (this directory is on home QNAP NAS and contains 4356 files). But it took 3 seconds to show up candidates, = when I input one character, filtering is also very slow. #+begin_src shell ls -l | wc -l #+end_src #+RESULTS[(2021-11-07 00:07:42) 8103eabbf0c6408f1637cafcb1621f3abd36f61d]: : 4356 Then I toke Emacs built-in profiler benchmarking, I attached the result in = to email attachment files. =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: #("text/plain" 0 10 (face nil)) Content-Disposition: attachment; filename=profiler-cpu-report.txt Content-Transfer-Encoding: quoted-printable Content-Description: profiler cpu report 516 94% - command-execute 516 94% - call-interactively 512 93% - byte-code 377 68% - read-extended-command 377 68% - completing-read 377 68% - completing-read-default 377 68% - apply 377 68% - vertico--advice 377 68% - apply 377 68% - # 296 54% - read-from-minibuffer 249 45% - vertico--exhibit 247 45% - vertico--update-candidates 246 44% - vertico--recompute-candidates 227 41% - vertico--all-completions 227 41% - apply 227 41% - completion-all-completions 227 41% - apply 227 41% - # 227 41% - completion--nth-completion 198 36% - completion--some 198 36% - # 153 27% - completion-basic-all-completions 153 27% - completion-pcm--all-completions 153 27% - all-completions 153 27% - # 153 27% - complete-with-action 7 1% - all-completions 5 0% - # 2 0% # 45 8% + completion-pcm-all-completions 29 5% + # 12 2% redisplay 1 0% + vertico-sort-history-length-alpha 1 0% + test-completion 14 2% + timer-event-handler 3 0% + minibuffer-mode 3 0% + minibuffer-inactive-mode 1 0% + redisplay_internal (C function) 135 24% - find-file-read-args 135 24% - read-file-name 135 24% - read-file-name-default 134 24% - completing-read 134 24% - completing-read-default 134 24% - apply 134 24% - vertico--advice 134 24% - apply 134 24% - # 71 12% - read-from-minibuffer 25 4% - vertico--exhibit 14 2% - vertico--arrange-candidates 13 2% - vertico--affixate 13 2% - # 13 2% - mapcar 13 2% - # 13 2% - marginalia--cached 7 1% - marginalia-annotate-command 6 1% marginalia--function-doc 1 0% marginalia-annotate-binding 6 1% - marginalia-annotate-file 6 1% - marginalia--annotate-local-file 1 0% marginalia--file-owner 1 0% vertico--format-candidate 9 1% + vertico--update-candidates 2 0% + vertico--display-candidates 14 2% - timer-event-handler 14 2% - apply 14 2% # 3 0% + minibuffer-inactive-mode 2 0% + minibuffer-mode 1 0% abbreviate-file-name 4 0% + funcall-interactively 22 4% - ... 22 4% Automatic GC 6 1% - redisplay_internal (C function) 4 0% - eval 3 0% - doom-modeline-segment--buffer-info 3 0% doom-modeline-update-buffer-file-state-icon 1 0% + cond 1 0% + # 1 0% + menu-bar-update-buffers 1 0% + global-font-lock-mode-check-buffers 1 0% + # 1 0% + winner-save-old-configurations --=-=-= Content-Type: #("text/plain" 0 10 (face nil)) Content-Disposition: attachment; filename=profiler-memory-report.txt Content-Transfer-Encoding: quoted-printable Content-Description: profiler memory report 10,151,482 99% - command-execute 10,151,482 99% - call-interactively 7,494,064 73% - byte-code 5,899,148 57% - find-file-read-args 5,899,148 57% - read-file-name 5,899,148 57% - read-file-name-default 5,895,052 57% - completing-read 5,895,052 57% - completing-read-default 5,895,052 57% - apply 5,895,052 57% - vertico--advice 5,895,052 57% - apply 5,895,052 57% - # 5,862,492 57% - read-from-minibuffer 5,301,415 51% - vertico--exhibit 3,083,630 30% - vertico--update-candidates 3,071,326 29% - vertico--recompute-candidates 2,716,316 26% - vertico--all-completions 2,712,172 26% - apply 2,712,172 26% - completion-all-completions 2,708,028 26% - apply 2,708,028 26% - # 2,708,028 26% - completion--nth-completion 1,731,808 16% - # 1,731,808 16% - completion--twq-all 1,695,864 16% - mapcar 1,137,304 11% - # 1,134,160 11% - minibuffer-maybe-quote-fil= ename 1,133,136 11% - minibuffer--double-dollars 872,688 8% - replace-regexp-in-string 260,448 2% apply 976,220 9% - completion--some 976,220 9% - # 905,916 8% - completion-pcm-all-completio= ns 905,916 8% - completion-pcm--find-all-co= mpletions 902,844 8% - completion-pcm--all-comple= tions 901,820 8% - all-completions 901,820 8% - completion-file-name-tab= le 227,596 2% - file-name-all-completio= ns 223,452 2% - ucs-normalize-hfs-nfd-= post-read-conversion 215,164 2% - ucs-normalize-HFS-NFC= -region 211,020 2% ucs-normalize-region 1,024 0% completion-pcm--pattern->= regex 3,072 0% completion-pcm--string->pa= ttern 62,120 0% + completion-basic-all-complet= ions 4,144 0% + marginalia--base-position 279,824 2% + vertico--filter-files 62,546 0% redisplay 4,144 0% + vertico-sort-history-length-alpha 3,072 0% vertico--remote-p 1,178,197 11% - vertico--display-candidates 1,151,749 11% - vertico--resize-window 1,055,653 10% - window-resize 1,055,653 10% window--resize-mini-window 26,448 0% apply 1,024,412 9% - vertico--arrange-candidates 873,772 8% - vertico--affixate 873,772 8% - # 873,772 8% - mapcar 873,772 8% - # 873,772 8% - marginalia--cached 562,828 5% - marginalia-annotate-command 451,584 4% marginalia-annotate-binding 83,620 0% + marginalia--function-doc 27,624 0% + marginalia--documentation 310,944 3% - marginalia-annotate-file 290,952 2% - marginalia--annotate-local-file 227,600 2% - file-attributes 227,600 2% - ucs-normalize-hfs-nfd-pre-wri= te-conversion 227,600 2% - ucs-normalize-HFS-NFD-region 227,600 2% ucs-normalize-region 10,848 0% + marginalia--time 7,232 0% marginalia--align 1,600 0% marginalia--full-candidate 1,048 0% file-size-human-readable 7,216 0% marginalia--remote-protocol 100,800 0% + vertico--format-candidate 9,048 0% seq-subseq 7,176 0% + # 6,000 0% + vertico--display-count 5,120 0% + completion-boundaries 2,048 0% + completion-metadata 320 0% vertico--prompt-selection 9,933 0% + redisplay_internal (C function) 9,816 0% + timer-event-handler 9,472 0% + rfn-eshadow-update-overlay 8,200 0% + minibuffer-mode 4,176 0% minibuf-eldef-setup-minibuffer 4,144 0% + marginalia--minibuffer-setup 4,144 0% + winner-save-unconditionally 320 0% + rfn-eshadow-setup-minibuffer 96 0% + undo-auto--undoable-change 64 0% + command-execute 32 0% + minibuffer-inactive-mode 2,048 0% abbreviate-file-name 2,048 0% + minibuffer-maybe-quote-filename 1,594,916 15% - read-extended-command 1,594,916 15% - completing-read 1,594,916 15% - completing-read-default 1,594,916 15% - apply 1,594,916 15% - vertico--advice 1,594,916 15% - apply 1,594,916 15% - # 1,560,692 15% - read-from-minibuffer 746,405 7% - vertico--exhibit 363,157 3% - vertico--display-candidates 354,973 3% - vertico--resize-window 8,184 0% + default-line-height 613 0% + window-resize 8,184 0% apply 258,120 2% - vertico--update-candidates 258,120 2% - vertico--recompute-candidates 252,728 2% - redisplay 17,048 0% - redisplay_internal (C function) 17,048 0% - # 17,048 0% - apply 17,048 0% - zoom--handler 17,048 0% - apply 17,048 0% - # 16,000 0% + zoom--get-frame-snapshot 4,144 0% + vertico-sort-history-length-alpha 89,288 0% + vertico--arrange-candidates 32,000 0% + vertico--display-count 1,280 0% vertico--prompt-selection 83,361 0% + redisplay_internal (C function) 9,304 0% + timer-event-handler 8,288 0% + marginalia--minibuffer-setup 4,176 0% minibuf-eldef-setup-minibuffer 4,160 0% + minibuffer-mode 4,048 0% + command-execute 2,096 0% + minibuffer-inactive-mode 2,657,418 25% - funcall-interactively 2,657,418 25% - execute-extended-command 2,657,370 25% - command-execute 2,657,370 25% - call-interactively 2,657,354 25% - funcall-interactively 2,656,640 25% profiler-report 714 0% profiler-start 48 0% + run-at-time 91,004 0% + redisplay_internal (C function) 4,144 0% + winner-save-old-configurations 1,048 0% + timer-event-handler 21 0% + # 0 0% ... --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmGGqvMACgkQG13xyVro msMbcAgAq4Ui3GZetMpNPbg0qrdCDePY8oWoRLAjmyODmHjY2WvsjFazbe61P/mA HuStSFht03PVl29tTcACrqm9yjvPVrudRweeN7CzFmtHn2lL34JbmJV9XeRr4f5R fdd0ZHr7Y6/9h08UnMotMNt3Y3599o1UKfZqF5nGVlG21rAW63C2FiBgJIxEHq47 8zySEHrKXoocSkx55O4y5qjM5+JNZrsnJ668tO6XT/v6ZWHAUi4RfNy3sVICqjBj 1kBKMlj/22xnap7+r+bk145v1w2ftPMWVPMEeVZiSI6LqyMk1DFzcWfrvgKTTS5A 7iM60DjOXBkehdp8kzVNgIqlOfktrQ== =RdnE -----END PGP SIGNATURE----- --==-=-=--